sql - DISTINCT with GROUP BY in MySQL -
if i'm selecting distinct values, group results, values distinct within each grouping, or across groupings?
for example:
month | id | 01 | 17 01 | 17 01 | 19 04 | 17 04 | 20
if run
select month, count(distinct id) table group month
what counts 2 months?
you 2 each month.
here sql fiddle showing results.
Comments
Post a Comment