Is it possible to group rows twice in MySQL?

Posted by DisgruntledGoat on Stack Overflow See other posts from Stack Overflow or by DisgruntledGoat
Published on 2010-03-30T00:05:05Z Indexed on 2010/03/30 0:13 UTC
Read the original article Hit count: 712

Filed under:
|

I have a table like this:

someid    somestring
1         Hello
1         World
1         Blah
2         World
2         TestA
2         TestB
...

Currently I'm grouping by the id and concatenating the strings, so I end up with this:

1         Hello,World,Blah
2         World,TestA,TestB
...

Is it possible to do a second grouping so that if there are multiple entries that end up with the same string, I can group those too?

© Stack Overflow or respective owner

Related posts about mysql

Related posts about group-by