Created
October 3, 2014 20:13
-
-
Save cleytonmessias/e690769a1ca288362b1e to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
A.id, | |
A.name, | |
COUNT(B.id) as Total, | |
YEAR(delivery_date) AS ano, | |
MONTH(delivery_date) AS mes | |
FROM stores as A | |
INNER JOIN sales as B | |
ON A.id = B.store_id | |
GROUP BY YEAR(delivery_date), MONTH(delivery_date) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment