mardi 14 avril 2015

Count items in column SQL query

Let's say I have a table that looks like,



id
2
2
3
4
5
5
5


How do I get something like,



id count
2 2
3 1
4 1
5 3


where the count column is just the count of each id in the id column?


Aucun commentaire:

Enregistrer un commentaire