Imagine I have a column of a table like this:
b
-
1
1
1
2
3
and I want to obtain
a | b
-----
1 | 3
2 | 1
3 | 1
representing the ocurrencies for that row. I have read that this would do the job:
select b, count(b) from table group by b
how ever, the result I get is just this:
3 | 5
What’s wrong?
As mentioned the SQL appears fine. I ran a quick test here with the following:
This gives the below result set:
Compare the above to your whole code, including the table creation etc.