Random order for group of rows in mysql
问题 maybe it´s easy but i have no clue how to handle this correctly. I have the following table t1 with this data: ----------------- | id | gr_id | ----------------- | 1 | a | | 2 | a | | 3 | b | | 4 | b | | 5 | c | | 6 | c | | 7 | d | | 8 | d | ----------------- I would like to get randomly gr_ids like this: ----------------- | id | gr_id | ----------------- | 3 | b | | 4 | b | | 5 | c | | 6 | c | | 7 | d | | 8 | d | | 1 | a | | 2 | a | ----------------- Getting ordered gr_ids ascend and descend