34,590
社区成员
发帖
与我相关
我的任务
分享
select a.*
from a
left join b on cast(a.starttime as time) between cast(b.starttime as time) and cast(b.endtime as time)
and cast(a.endtime as time) between cast(b.starttime as time) and cast(b.endtime as time)
where b.starttime is null
select * from a where exists(
select 1 from b where b.startTime between a.startTime and a.endTime
)
union
select * from a where exists(
select 1 from b where b.endTime between a.startTime and a.endTime
)
SELECT * FROM A,B WHERE a.startTime BETWEEN B.startTime AND B.endTime
UNION ALL
SELECT * FROM A,B WHERE a.endTime BETWEEN B.startTime AND B.endTime
select a.*
from a
left join b on a.starttime and b.starttime and b.endtime
and a.endtime and b.starttime and b.endtime
where b.starttime is null