How can I count duplicates rows (where the date and names are the same) using a select statement?
Here is my table
id date name
1 01/02/12 sam
2 01/02/12 john
3 02/04/12 eddie
4 01/06/12 joe
5 01/02/12 john
6 01/02/12 john
7 02/04/12 eddie
8 01/05/12 eddie
9 01/07/12 joe
Result should be like this:
id date name count
1 01/02/12 sam 1
01/02/12 john 3
02/04/12 eddie 2
4 01/06/12 joe 1
8 01/05/12 eddie 1
9 01/07/12 joe 1
I need a third coloumn in result set which value will be count column. also i dont need the id if the count is more than 1 (i think that would be impossible anyways). I am using mysql.
Thanks for advice.