排序mysql结果数据

for example i have a table which looks like :

id | date | ...

  1. 20.07.2011
  2. 20.07.2011
  3. 20.07.2011
  4. 20.07.2011
  5. 21.07.2011
  6. 21.07.2011
  7. 21.07.2011
  8. 21.07.2011
  9. 25.07.2011
  10. 25.07.2011
  11. 25.07.2011
  12. 25.07.2011
  13. 25.07.2011
  14. 25.07.2011
  15. 25.07.2011
  16. 31.07.2011
  17. 31.07.2011
  18. 31.07.2011
  19. 02.08.2011
  20. 02.08.2011
  21. 02.08.2011
  22. 02.08.2011
  23. 02.08.2011
  24. 02.08.2011
  25. 02.08.2011
  26. 02.08.2011

how i can get each date and ids for each date in easiest way ( maybe only with a query )

i need something like :

20.07.2011 {1,2,3,4}

21.07.2011 {5,6,7,8}

25.07.2011 {9,10,11,12,13,14,15}

31.07.2011 ...

02.08.2011 ...

SELECT `date`, GROUP_CONCAT(`id`) FROM `example` GROUP BY `date`

GROUP_CONCAT on MySQL docs

You can append/preppend curly braces and sperate the id's how you like it. Just look at the docs.

select `date`, group_concat(`id`) from `table` group by `date`