Skip to content
Advertisement

Why integer cast is not working with integer group_concat() list?

I’m stuck at the query where I need to concat IDs of the table. And from that group of IDs, I need to fetch that rows in sub query. But when I try to do so, MySQL consider group_concat() as a string. So that condition becomes false.

*************** Original Query Below **************

Any solutions will be appreciated.

Advertisement

Answer

Try to replace the sub-query

with below to count using SUM and CASE, it will make use of the GROUP BY

and the same for completedRides

And move to using JOIN instead of implicit joins

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement