Created
June 13, 2014 16:55
-
-
Save 3leftturns/86b86122c93a4f89281c to your computer and use it in GitHub Desktop.
Got a list of sales in a table and need to summarize total sales for each sales agent? This GIST can help. Selects sales agent and sums their sales, then groups into 1 line per sales agent.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT salesagent, SUM(saleamount) as salestotal | |
FROM sales.salestable | |
GROUP BY salesagent; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment