Created
May 15, 2014 22:51
-
-
Save kalenjordan/9459c7f45ad8f1512669 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 DATE_FORMAT(o.created_at, "%b"), count(*) | |
FROM sales_flat_order AS o | |
WHERE created_at BETWEEN | |
DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 12 MONTH), "%Y-%m-01") | |
AND | |
LAST_DAY(DATE_SUB(NOW(), INTERVAL 1 MONTH)) | |
GROUP BY DATE_FORMAT(o.created_at, "%m") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment