现有两句sql语句,
select b.t2
from table1 a,table2 b
where a.t1 between b.t1 and b.t2;select a.t1 from table1 a
where not exists(
select 1 from table2 b
where a.t1 between b.t1 and b.t2);这2句如何合并成一句sql语句啊,请各位帮忙
select b.t2
from table1 a,table2 b
where a.t1 between b.t1 and b.t2;select a.t1 from table1 a
where not exists(
select 1 from table2 b
where a.t1 between b.t1 and b.t2);这2句如何合并成一句sql语句啊,请各位帮忙
from table1 a,table2 b
where a.t1 between b.t1 and b.t2;
union
select a.t1 from table1 a
where not exists(
select 1 from table2 b
where a.t1 between b.t1 and b.t2);
from table1 a,table2 b
from table1 a
left outer join table2 b
on a.t1 between b.t1 and b.t2