Get rows of at least 3 days ago

3

I have a table with column datetime and I need to get the results that already have 3 days of existence, all with more than 3 days, I tried to use

SELECT *, DATE_FORMAT(date, '%m/%d/%Y') FROM tb WHERE DATE(date) = CURDATE() - INTERVAL 3 DAY ORDER BY ID DESC

But it did not.

    
asked by anonymous 14.01.2015 / 23:52

1 answer

4

Your where should be:

WHERE DATE(date) < DATE_SUB(CURDATE(), INTERVAL 3 DAY)
    
14.01.2015 / 23:58