I have a time string as 8:00AM, 9:00AM etc. stored in mysql table. I want to check time range, if time 11:00AM comes in between time 9:00AM – 6:00PM? How to find it out in mysql.
Time is stored as below
day depart_time return_time
Monday 9:00am 5:00pm
Wednesday 9:30am 4:30pm
Tuesday 9:00am 3:00pm
Substitute
@check_timewith the time you want to check. This query will work across times that span over two days.Sample data:
Sample output: