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)
日期段交叉
最新推荐文章于 2018-05-15 16:50:25 发布
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)