mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
GROUP CONCAT throught IN statement #4966
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @miklio on GitHub (Jan 11, 2016).
Originally assigned to: @Ocramius on GitHub.
Hello, this is my pb :
Note that group concat function is a 3thd extension
dql result like :
and i have a :
Thank u !
@Ocramius commented on GitHub (Jan 11, 2016):
GROUP_CONCATretrieves a string, not a list of identifiers that you can pass to anIN()expression. Are you sure that you are using the correct logic here?The correct workaround (assuming
GROUP_CONCATis what you want) is something like:@Ocramius commented on GitHub (Jan 11, 2016):
Closing, since this isn't an actual bug. Hope the reply above helps though :-)
@miklio commented on GitHub (Jan 11, 2016):
thanks for ur reply but :
:(
@deeky666 commented on GitHub (Jan 12, 2016):
@mickaelCOLLET AFAIK
GROUP_CONCATis MySQL specific and therefore not supported in DQL out of the box. You'll have to create a custom DQL function to use it in DQL. See http://stackoverflow.com/questions/10850345/symfony2-how-to-use-group-concat-in-querybuilder@deeky666 commented on GitHub (Jan 12, 2016):
Sorry didn't read that you are already using a custom DQL function for that. Then most probably something is wrong with that third party code. Please report an issue there.
@miklio commented on GitHub (Jan 12, 2016):
i have create a custom DQL for this function and that work very well, the problem is not the group_concat function, but to pass a indentifier in the IN expr fail
@miklio commented on GitHub (Jan 12, 2016):
Here the custom group concat function :
https://github.com/beberlei/DoctrineExtensions/blob/master/src/Query/Mysql/GroupConcat.php
@deeky666 commented on GitHub (Jan 12, 2016):
@mickaelCOLLET your query is wrong.
GROUP_CONCATreturns a concatenatedstring, not a list of values. So usingIN()does not make much sense anyways. I guess you'll have to rethink about your query and what you actually want to do.DQL's
InExpressiononly accepts literals and subselects.@miklio commented on GitHub (Jan 12, 2016):
Ok i see, thank u for all !