日期段交叉

SELECT * FROM `t_order` where
(('2008-01-08'>=startDate) and ( '2008-01-03'<=startDate)) or
(('2008-01-03'<=endDate) and ('2008-01-08'>=endDate)) or
 (('2008-01-03'>=startDate) and ('2008-01-08')<=endDate)

你可能感兴趣的:(日期)