I have a table that has an ID field.
ID
1234
1234
1235
1235
1235
1236
And I would like to get the following result via query:
ID ID_Counter
1234 2
1234 2
1235 3
1235 3
1235 3
1236 1
Where in the second column the field value would be the number of times the ID of that row appears in the ID column.
I tried the query: select ID, Count(ID) from tabela group by ID
, but the result is:
ID ID_Counter
1234 2
1235 3
1236 1
It would be type cont.se()
of Microsoft Excel, but I'm not sure how to create the query in the MySQL Workbench.