Consider a MYSQL table called "comments" with 2 fields, "hostname" and "username".
How do I return a list sorted by hostname where the 2nd column is a list of usernames associated with each hostname? I can see how to do this with a scripting language like py, but is it possible as a standard sql qurey?
If I do "SELECT hostname,count(distinct(username)) FROM comments GROUP BY hostname" I get almost the right result, except It only gives me the number of usernames associated with each hostname instead of the actual list of usernames associated with each hostname... trying distinct(username) without the count() around it returns a syntax error.