I have a table that contains too many records and each bunch of records belong to someone:
---------------------
id | data | username
---------------------
1 | 10 | ali
2 | 11 | ali
3 | 12 | ali
4 | 20 | omid
5 | 21 | omid
6 | 30 | reza
now I want to create a query to result me like this:
1-10-ali 4-20-omid 6-30-reza 2-11-ali 5-21-omid 3-12-ali
Is there anyway to create a query to result me one record per each username and then one from another, and another to the end?