Created
December 15, 2013 05:49
-
-
Save jgrar/7969406 to your computer and use it in GitHub Desktop.
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 | |
sum(Total) AS Total, State | |
FROM ( | |
SELECT | |
State, Total | |
FROM | |
WorkOrders | |
INNER JOIN | |
Customers ON CID = ID | |
WHERE Type != "Warranty" | |
UNION | |
SELECT | |
State, 80 | |
FROM | |
WorkOrders | |
INNER JOIN | |
CustomersRetail ON CID=ID | |
WHERE Type = "Warranty" | |
) | |
GROUP BY State; |
Author
jgrar
commented
Dec 27, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment