Set group_concat_max_len and Select

Hi Experts,

Can anyone tell me why when I run SET group_concat_max_len followed by SELECT I do not get any rows returned.

For example, I set my max_len to 5 just so I see difference in results with the following code:

SET SESSION group_concat_max_len=5; /*3423543543;*/

SELECT locs.id, name, default_time, default_vehicle, GROUP_CONCAT(DISTINCT assoc.agent_id ORDER BY agents.fName, agents.lName) AS agent_ids FROM locations AS locs INNER JOIN location_agent_assoc AS assoc ON locs.id = assoc.location_id INNER JOIN agents ON assoc.agent_id = agents.id WHERE locs.archived = 0 AND agents.archived = 0 GROUP BY locs.id, name, default_time, default_vehicle ORDER BY locs.name

Open in new window


in phpMyAdmin, I just see #Rows: 231, any my query is edited as follows:
SET SESSION group_concat_max_len=5;# MySQL returned an empty result set (i.e. zero rows). /*3423543543;*/ SELECT locs.id, name, default_time, default_vehicle, GROUP_CONCAT(DISTINCT assoc.agent_id ORDER BY agents.fName, agents.lName) AS agent_ids FROM locations AS locs INNER JOIN location_agent_assoc AS assoc ON locs.id = assoc.location_id INNER JOIN agents ON assoc.agent_id = agents.id WHERE locs.archived = 0 AND agents.archived = 0 GROUP BY locs.id, name, default_time, default_vehicle ORDER BY locs.name # Rows: 231 

Open in new window


However, I do not also see the 231 Rows, but if I remove the SET statement, I do see my 231 rows, but not with max len of 5.  This is also happening with my PHP code, where with SET, I get no rows returned.

So my question now is, why with the SET statement, I don't see my rows.

Any help will be greatly appreciated.
APD TorontoSoftware DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ray PaseurCommented:
Can you please help us by providing the SSCCE?  What is the test data set?  What is the results set you need?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
APD TorontoSoftware DeveloperAuthor Commented:
Will repost
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.