A guy, a blog and the internet
Archive for May, 2009
MySQL group_concat not returning all data.
May 30th
So working on a project for work, and it was not behaving as expected. I was selecting all the ID’s from a table that was linked to a couple of other tables, it turns out that it wasn’t returning all the id’s as expected as there is a limit on the amount of data that GROUP_CONCAT will return. MySQL Manual – GROUP_CONCAT
Well instead of using GROUP_CONCAT I’m now selecting the id’s individually, and this is now working.
Also there seems to be a limit on the number of items you can have in a IN clause: SELECT * FROM table WHERE field IN (xxx,xxx,xxx) so I’ve had to split these into 1000 peice chunks.
All seems to be working now after that, we’ll see how it goes…