Hard to capture the problem in a single sentence, but the problem is a simple one. Table looks like this:
col_a col_b
v1 c
v2 c
v3 c
v5 d
v2 d
v1 a
v5 a
v7 a
v4 a
Each row is distinct, and I need a count of the rows for each unique value of col_b. So, my result set for this table should be:
c 3
d 2
a 4
I have no idea how to think this thru and do it.
I'm assuming that you're asking how to do this in SQL.
Use
GROUP BY
with an aggregate function, like this: