Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Find data for one day only in MySQL
-- Find data for May 8, 2018 only.
-- WRONG
SELECT * FROM inbox WHERE datetime >= date('2018-05-08') and datetime < date('2018-05-08');
-- Correct
SELECT * FROM inbox WHERE datetime >= date('2018-05-08') and datetime < date('2018-05-08') + interval 1 day;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.