发布网友 发布时间:2022-05-05 18:40
共2个回答
热心网友 时间:2022-05-05 20:09
把两个表的相同字段union all 一下,追答select *
from (select *
from (select 1 as v_num
from al
union all
select 2 as v_num
from al
union all
select 3 as v_num
from al
union all
select 4 as v_num
from al
union all
select 5 as v_num from al) a
union all
select *
from (select 3 as v_num
from al
union all
select 4 as v_num
from al
union all
select 5 as v_num
from al
union all
select 6 as v_num
from al
union all
select 7 as v_num from al) b)
group by v_num
having count(1) = 1