Group by on Select_SQL
Posted: Fri Jun 03, 2016 3:54 am
I have a file with sales by salesman number and amount. I'm trying to produce a list of
the top salesmans for a given day. Most salesman have multiple entries.
In SQL I would code it as:
Select SMN,sum(amt)
from Sales
Group by SMN
Order by sum(amt) desc
How would I code my Select_SQL to Group by SMN field, summing AMT field ?
the top salesmans for a given day. Most salesman have multiple entries.
In SQL I would code it as:
Select SMN,sum(amt)
from Sales
Group by SMN
Order by sum(amt) desc
How would I code my Select_SQL to Group by SMN field, summing AMT field ?