Monday, July 31, 2017
MySQL select records with timestamp in the previous day, no matter what time of day it is now
WHERE timestamp >= DATE_SUB(CONCAT(CURDATE(), ' 00:00:00'), INTERVAL 24 HOUR) AND timestamp < DATE_ADD(DATE_SUB(CONCAT(CURDATE(), ' 00:00:00'), INTERVAL 24 HOUR), INTERVAL 24 HOUR)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment