How do I query between two time range using MySQL?
it is similar to this question provided in the above link but the match_time was divided into two columns, i.e. match_start_time and match_end_time,
match_start_time <= CAST('10:00:00' AS time) AND match_end_time >= (CAST('12:00:00' AS time))
This was the query through which i tried but was not getting the correct result.
example
consider match start and end time being:-
01:30 - 03:30, 05:00 - 06:30, 03:00 - 21:30, 14:00 - 09:00
then if i pass 00:00 - 10:00 as min and max, then i get
01:30 - 03:30, 05:00 - 06:30, 14:00 - 09:00
but not sure whether 14:00 - 09:00
should be included.
Also if they pass 18:00 - 09:00
Then how to get the result if user provided min time is greater than max time
Sorry for bad English, please help
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…