表A:
ID Model StartTime EndTime
1 Test 2015-09-21 11:31:07.000 2015-09-21 12:31:07.000
2 Test 2015-09-22 01:31:07.000 2015-09-22 04:31:07.000
3 Test 2015-09-20 05:31:07.000 2015-09-20 07:31:07.000
表B:
ID MODEL VALUE TIME
我现在想在表B中取TIME不在表A的多个时间区间(StartTime到EndTime)中的value。请教怎么搞??
------解决思路----------------------
select *
from B
where not exists(select 1 from A where b.time between starttime and endtime)