select t1.id,t1.name from t1 Intersect select t2.id,t2.name from t2;select t1.id,t1.name from t1 Minus select t2.id,t2.name from t2;
解决方案 »
- ******* 一行数据按属性转成多行 ******
- oracle数据库删除raid1镜像后,数据库能正常使用么,需要不需要重新建库操作
- 请问这样的sql怎么写?
- 索引问题
- 一个简单很难写的SQL 查询,解决给100分???
- 在线等:哪里有oracle软件的下载呀?应者有分!
- ###敬请关注----数据表空间的问题!!!
- 用sqlplus是不是无法查看blob类型数据?
- tns 紧急求救:服务里面没有oracletns 一项,从那里运行??
- 还分!
- Oracle怎么书写sql server中top 3之类的sql(就是成绩前三名的学生之类需求)
- 在A表的触发器中不能再对A表进行操作,为什么? 我也实在没办法了!!!
---------- ----------
3 4
5 6
6 7
1 2
2 3
SELECT yh
FROM aazz
MINUS
SELECT yh2 FROM aazz
YH
----------
1
5
SELECT yh
FROM aazz
intersect
SELECT yh2 FROM aazz
YH
----------
2
3
6
create table test2(serialno number,clientid number,thisbargain number,usenum number);
insert into test(serialno,clientid,thisbargain,usenum)
select 1,1,10,1 from dual union all select 2,1,10,2 from dual
union all select 3,1,10,4 from dual union all select 4,2,10,1 from dual
union all select 5,2,10,4 from dual union all select 6,2,10,5 from dual;
insert into test2(serialno,clientid,thisbargain,usenum)
select 1,1,10,1 from dual union all select 2,1,10,2 from dual
union all select 3,1,10,4 from dual union all select 4,2,10,1 from dual
union all select 7,2,10,4 from dual union all select 8,2,10,5 from dual;select * from test intersect select * from test2;select * from test minus select * from test2;drop table test;
drop table test2;