I have an application storing the times a restaurant is open:
My code to get the currently open restaurants. My SQL query (simplified) looks like
SELECT *
FROM `restaurants` r
WHERE r.from <= NOW()
AND r.to >= NOW();
The problem here is, there's an entry which rolls over -- it's for a restaurant open from 11 AM to 3 AM the next day.
What would be a good query to capture that particular restaurant?