I need to COUNT() (or maybe another MySQL function) rows of my query, but I need diferent counts, like this:
What I am getting:
id | date | costumer_id
-----+------- ----+-------------
1 | 2012-10-05 | 103
2 | 2012-10-05 | 103
3 | 2012-10-05 | 103
4 | 2012-10-05 | 59
5 | 2012-10-05 | 59
6 | 2012-10-05 | 90
What I need:
id | date | costumer_id | count
-----+------------+-------------+------
1 | 2012-10-05 | 103 | 3
5 | 2012-10-05 | 59 | 2
6 | 2012-10-05 | 90 | 1
You need a simple group by query. I suspect you are leaving the id in the group by. Try something like this: