SQL> select cl090_son_sub from cl090 where cl090_son_sub in (select cl120_son_sub from cl120 where cl120_depart_no='cw' and cl120_school='yz' and cl120_yymm='200511');CL090_SON_
----------
0201
0801SQL> select cl080_sub_no from cl080 where cl080_sub_no in (select cl120_sub_no from cl120 where cl120_depart_no='EM01' and cl120_school='EM' and cl120_yymm='200511');CL080_
------
02
08SQL> select a.cl080_sub_no,b.cl090_son_sub from cl080 a,cl090 b
where
a.cl080_sub_no in
(select cl120_sub_no from cl120 where cl120_depart_no='cw' and cl120_school='yz' and cl120_yymm='200511')
and
b.cl090_son_sub in (select cl120_son_sub from cl120 where cl120_depart_no='cw' and cl120_school='yz' and cl120_yymm='200511');CL080_ CL090_SON_
------ ----------
02 0201
08 0201
02 0801
08 0801<问题>
如何才能得到:
CL080_ CL090_SON_
------ ----------
02 0201
08 0801
----------
0201
0801SQL> select cl080_sub_no from cl080 where cl080_sub_no in (select cl120_sub_no from cl120 where cl120_depart_no='EM01' and cl120_school='EM' and cl120_yymm='200511');CL080_
------
02
08SQL> select a.cl080_sub_no,b.cl090_son_sub from cl080 a,cl090 b
where
a.cl080_sub_no in
(select cl120_sub_no from cl120 where cl120_depart_no='cw' and cl120_school='yz' and cl120_yymm='200511')
and
b.cl090_son_sub in (select cl120_son_sub from cl120 where cl120_depart_no='cw' and cl120_school='yz' and cl120_yymm='200511');CL080_ CL090_SON_
------ ----------
02 0201
08 0201
02 0801
08 0801<问题>
如何才能得到:
CL080_ CL090_SON_
------ ----------
02 0201
08 0801
解决方案 »
- VS 2008 在同一台机子上连接oracle9i的数据库时,oracle9i要同时装上服务器和客户端?还是只装服务器就够了啊?
- 数据库突然多出了 KE_TOKUI_1018115735 这张表
- 行链清除小问题??
- plsql里面如何用命令查看 当前用户以及表所在的表空间?
- pL/SQL DEVELOPER 7中 中文字符拷贝到其它软件例如Notepad会显示为乱码?
- Error in run runInstaller.sh............
- 继penitent,bzszp步步高升,再次祝贺黄山转换新工作,公喜!
- @@@怎样删除一个表中的数据?急!!!在线求救!!!
- 请问一下,linux下面的Oracle是不是免费的?
- 求助:oracle对特定字段查询特别慢
- 请问如何取某一范围内的纪录,比如取符合条件的,从第10条至第20条之间的纪录?
- 如何SQL语句在orcale中取空表的字段名及类型?
------ ----------
02 0201
08 0201
02 0801
08 0801
没有关联条件,得到前两个结果集的笛卡尔集.SQL> create table testa as select * from v$option where rownum<3;表被创建SQL> select * from testa;PARAMETER VALUE
---------------------------------------------------------------- ----------------------------------------------------------------
Partitioning TRUE
Objects TRUESQL> create table testb as select * from v$option where rownum<3;表被创建SQL> select a.parameter,b.parameter as val from testa a,testb b;PARAMETER VAL
---------------------------------------------------------------- ----------------------------------------------------------------
Partitioning Partitioning
Partitioning Objects
Objects Partitioning
Objects ObjectsSQL> select r1.parameter,r2.parameter as val from (select rownum rn,a.* from testa a) r1,(select rownum rn,b.* from testb b) r2 where r1.rn=r2.rn;PARAMETER VAL
---------------------------------------------------------------- ----------------------------------------------------------------
Partitioning Partitioning
Objects Objects