I have a table that looks like this.
id | open_hours | other |
---|---|---|
1 | ["09:00-14:30", "19:00-21:30"] | jj |
2 | ["10:00-14:00"] | kk |
3 | ["01:00-04:00", "05:00-08:00", "10:00-15:00", "16:00-00:00"] | pp |
and I want to know if the at the moment(NOW()) the store is open, i.e. it falls in one of the range given for a particular day. How can I do that within an SQL query? I am trying to achieve it by something like
SELECT * FROM data
WHERE TIME(NOW) BETWEEN one of the ranges specified in open_hours;