Mysql
 sql >> Datenbank >  >> RDS >> Mysql

Abfrage, um alle Zeilen des vorherigen Monats abzurufen

SELECT * FROM table
WHERE YEAR(date_created) = YEAR(CURRENT_DATE - INTERVAL 1 MONTH)
AND MONTH(date_created) = MONTH(CURRENT_DATE - INTERVAL 1 MONTH)