Skip to main content

MySQL: Query to get all rows from previous month


SELECT *


FROM table


WHERE


YEAR(date_created) = YEAR(CURRENT_DATE - INTERVAL 1 MONTH)


AND


MONTH(date_created) = MONTH(CURRENT_DATE - INTERVAL 1 MONTH)

Comments