Jak dostać się wczoraj w MySQL
SELECT SUBDATE(NOW(),1);
Envious Earthworm
SELECT SUBDATE(NOW(),1);
SELECT * FROM my_table WHERE created_at > DATE_SUB(NOW(), INTERVAL 1 DAY)
#Since yesterday
select * from orders where created_at > (CURDATE() - INTERVAL 1 DAY)
#the day before yesterday and yesterday
SELECT * from orders where created_at BETWEEN (CURDATE()- INTERVAL 2 DAY) AND (CURDATE()- INTERVAL 1 DAY);