Created
April 6, 2022 17:27
-
-
Save yibudak/cf2a3006c10de070e1ec520207e15355 to your computer and use it in GitHub Desktop.
Get Last 30 Days Records Count Grouped in MySQL
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 DATE_FORMAT(DATE, '%m.%d.%Y') AS date, count(*) AS count | |
FROM table | |
WHERE DATE BETWEEN NOW() - INTERVAL 30 DAY AND NOW() | |
GROUP BY date | |
ORDER BY date ASC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment