oracle 如何对比一个表的字段值与另一个表的字段值,并把不同查询出来
3个回答
展开全部
两张表的全连接,下面两个自己试一下吧
select
case when b.dsc=null then a.dsc else end as adsc
case when a.dsc=null then b.dsc else end as bdsc
from a full join b
on a.dsc=b.dsc
或
select * from
(
select a.dsc as adsc,b.dsc as bdsc
from a full join b
on a.dsc=b.dsc
) ab
where ab.adsc=null or ab.bdsc=null
select
case when b.dsc=null then a.dsc else end as adsc
case when a.dsc=null then b.dsc else end as bdsc
from a full join b
on a.dsc=b.dsc
或
select * from
(
select a.dsc as adsc,b.dsc as bdsc
from a full join b
on a.dsc=b.dsc
) ab
where ab.adsc=null or ab.bdsc=null
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
(SELECT a.deviceno FROM gcsiuclaim a
MINUS
SELECT b.deviceno FROM gcsiu b where b.deviceno is not null)
UNION ALL
(SELECT b.deviceno FROM gcsiu b where b.deviceno is not null
MINUS
SELECT a.deviceno FROM gcsiuclaim a)
MINUS
SELECT b.deviceno FROM gcsiu b where b.deviceno is not null)
UNION ALL
(SELECT b.deviceno FROM gcsiu b where b.deviceno is not null
MINUS
SELECT a.deviceno FROM gcsiuclaim a)
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询