Order and group by date in Mysql
Posted
by
Alexd2
on Stack Overflow
See other posts from Stack Overflow
or by Alexd2
Published on 2011-01-12T00:49:05Z
Indexed on
2011/01/12
0:53 UTC
Read the original article
Hit count: 118
Hi all and thanks in advance. I have a small problem which can not resolve, I have this table, and I want to sort by date and group it (but I only show 1 per idCAT)
| id | idcat | name | date |
| 1 | 3 | xx | 2011-01-02 |
| 2 | 4 | xf | 2011-01-02 |
| 3 | 3 | cd | 2011-01-01 |
| 4 | 1 | cg | 2011-01-04 |
| 5 | 4 | ce | 2011-01-06 |
would like to stay that way, try in a way but I can not
| 2 | 4 | xf | 2011-01-01 |
| 3 | 3 | cd | 2011-01-02 |
| 4 | 1 | cg | 2011-01-04 |
© Stack Overflow or respective owner