I think I have done this before, but it could also be a PHP function. I would like to make a MySQL query (in a MySQL client, not PHP) and get for example
Foo A
B
C
Bar B
D
E
Instead
Foo A
Foo B
Foo C
Bar B
Bar D
Bar E
This, of course, will only make sense if it was ordered by this first column. I’m not sure that this is possible, but, as I said, I would like to remember that I did it once, but I can’t remember how or through some PHP “magic” ...
Update: I suddenly remembered where I used it. What I was thinking was a modifier WITH ROLLUPfor GROUP BY. But I also found that he is not doing what I think here, so my question is still standing. Although I do not think that there is a solution now. But smart people proved that I was wrong before: P
: , , " ". Foo , . A, B, C, D, E - , .
attendee (id, first_name, last_name, ...)
attendees_options (attendee_id, option_id)
option (id, name, description)