话不多说,直接上SQL:
SELECT * FROM `USER` WHERE ( `start_time` > $startTime AND `start_time` < $endTime ) OR ( `start_time` =< $startTime AND `end_time` >= $endTime ) OR ( `end_time` > $startTime AND `end_time` < $endTime )
话不多说,直接上SQL:
SELECT * FROM `USER` WHERE ( `start_time` > $startTime AND `start_time` < $endTime ) OR ( `start_time` =< $startTime AND `end_time` >= $endTime ) OR ( `end_time` > $startTime AND `end_time` < $endTime )