我有两个表,其中A表查询结果如下:编号 类型
10813 申请表
10813 登记证
10813 执照
10813 证明文件
10813 机构代码证
10827 登记证
10827 资信证明
10827 执照
10827 证明文件
10827 机构代码证B表查询结果如下:编号 类型10798 执照
10798 资信证明
10798 申请表
10798 登记证
10798 机构代码证
10798 证明文件
10803 申请表
10803 机构代码证
10803 登记证
10803 证明文件
10803 资信证明
10803 执照我想查询编号为10803中A表和B表内容不一样的部分查询结果为:10803 资信证明
10813 申请表
10813 登记证
10813 执照
10813 证明文件
10813 机构代码证
10827 登记证
10827 资信证明
10827 执照
10827 证明文件
10827 机构代码证B表查询结果如下:编号 类型10798 执照
10798 资信证明
10798 申请表
10798 登记证
10798 机构代码证
10798 证明文件
10803 申请表
10803 机构代码证
10803 登记证
10803 证明文件
10803 资信证明
10803 执照我想查询编号为10803中A表和B表内容不一样的部分查询结果为:10803 资信证明
解决方案 »
- 如何快速的学习JAVA语言
- 神奇的问题,IP可以访问,域名不能访问
- 将一个数据库中的数据导入另外一个数据库中,如何实现多线程?
- log4j配置后tomcat启 动老是报错
- Timer周期设为10分钟,程序正确,周期设为1天的时候,Timer运行一次后就不动行了,是怎么回事?
- jboss服务器报错,如何解决
- 字符串截取问题
- 我是用的jxl调用winrar进行的压缩,怎么判断压缩完成
- 我装了jdk1.2.2和tomcat4.1。打开http://localhost:8080/却无法显示?
- 如何向javabean的构造函数传参数?
- 关于在有返回值的方法中抛出RuntimeException
- 急!!!!JXLS 模版导出怎么横向输出
select distinct b.vender_id, a.name from qualification a, upload_file b where a.type = b.sortname and a.opening = 'Y' and b.sortname is not null order by b.vender_id第二个表的查询语句
select c.vender_id,d.type from vender c,qualification d where d.opening='Y' and d.display='Y' order by c.vender_id其中结果集是这两个查询结构的补集
with a as(
select 10813 id,'申请表' type from dual union all
select 10813 id,'登记证' type from dual union all
select 10813 id,'执照' type from dual union all
select 10813 id,'证明文件' type from dual union all
select 10813 id,'机构代码证' type from dual union all
select 10827 id,'登记证' type from dual union all
select 10827 id,'资信证明' type from dual union all
select 10827 id,'执照' type from dual union all
select 10827 id,'证明文件' type from dual union all
select 10827 id,'机构代码证' type from dual
),
b as(
select 10798 id,'执照' type from dual union all
select 10798 id,'资信证明' type from dual union all
select 10798 id,'申请表' type from dual union all
select 10798 id,'登记证' type from dual union all
select 10798 id,'机构代码证' type from dual union all
select 10798 id,'证明文件' type from dual union all
select 10813 id,'申请表' type from dual union all
select 10813 id,'机构代码证' type from dual union all
select 10813 id,'登记证' type from dual union all
select 10813 id,'证明文件' type from dual union all
select 10813 id,'资信证明' type from dual union all
select 10813 id,'执照' type from dual
)
select *
from ((select a.id,a.type from a
minus
select b.id,b.type from b)
union all
(select b.id,b.type from b
minus
select a.id,a.type from a)) t
where id=10813; ID TYPE
---------- ----------
10813 资信证明大哥,上下2张表编号不一样,我就都改为10813,没10803了