I have a table like this
poll_id|poll_item ------------------ 1 | John 1 | John 1 | John 3 | John 1 | Bond 1 | Austin
How can I get the count of all values with Poll_id = 1 so I can get
John | 3 Bond | 1 Austin | 1
using sql
Use group by with where:
group by
where
select poll_item, count(*) from t where poll_id = 1 group by poll_item;
2.1m questions
2.1m answers
60 comments
57.0k users