I know that if I want to query the date 5 days ago, I use the following Query:
SELECT * FROM Tabela WHERE Data = DATE_SUB(CONCAT(CURDATE(), ' 00:00:00'), INTERVAL 5 DAY);
Or want to go back two months ago I replace DAY
with MONTH
:
SELECT * FROM Tabela WHERE Data = DATE_SUB(CONCAT(CURDATE(), ' 00:00:00'), INTERVAL 2 MONTH);
But how do I go back 2 months and 5 days?