How to SELECT DISTINCT col1 and SUM col2. Is it possible to do it with just one query?
Thank You
Printable View
How to SELECT DISTINCT col1 and SUM col2. Is it possible to do it with just one query?
Thank You
Taken you would like to have the sum of col2 over all occurences of col1:
Select col1, SUM (col2)
from yourtable
group by col1
It works. Learned more that you think.
All the best.