select * from dic a,
(select dic.col from dic , a where dic.col = a.col) union all
(select dic.col from dic , a where dic.col = b.col) union all
(select dic.col from dic , a where dic.col = c.col) union all
(select dic.col from dic , a where dic.col = d.col) union all
(select dic.col from dic , a where dic.col = e.col) )b
where a.col<>b.col
(select dic.col from dic , a where dic.col = a.col) union all
(select dic.col from dic , a where dic.col = b.col) union all
(select dic.col from dic , a where dic.col = c.col) union all
(select dic.col from dic , a where dic.col = d.col) union all
(select dic.col from dic , a where dic.col = e.col) )b
where a.col<>b.col
解决方案 »
- 如何知道一个sql 打开了多少个cursor
- 关于sql报表查询语句求解的问题。
- 树状查询是否可以获取到起始节点并分组
- 关于Oracle10g的几个基础问题,谢谢帮忙看看。
- 求ORACLE项目开发方面的电子书籍
- 简单问题,没人知的。。SQL/PLUS 窗口登陆,查询后不能拉动滚动条??
- oracle数据库管理问题(100分)
- 关于用jsp访问oracle8.15的问题!请教高手!
- 用户和实例的关系是怎么样的?怎么建一个实例?
- xp客户端通过程式无法访问oracle数据库,DNS解析和tnsping也可以通
- 在select中,如何将返回的某行(字符串)与一个字符串相加?
- 难道就没有高手了吗?版主大哥去哪了啊!小弟在次跪求各位帮帮忙!!最后30救命分
select * from dic a,
((select dic.col from dic , a where dic.col = a.col) union all
(select dic.col from dic , b where dic.col = b.col) union all
(select dic.col from dic , c where dic.col = c.col) union all
(select dic.col from dic , d where dic.col = d.col) union all
(select dic.col from dic , e where dic.col = e.col) )b
where a.col<>b.col答案不对啊,取出了那几亿条数据.
( select B.ID from B)
要对两个表进行全表扫描,你在sqlplus中看一下查询计划就知道了
sql server 也有类似的,就是QA(查询分析器)
要在sqlplus 中查看查询计划,要生成一个planTable的表,具体
我就不多说了,这样的帖子太多了 最后说一句,很多人都回答了你的问题,楼主还没给分!
呵呵
(
select a.col from a
union
select a.col from b
union
select a.col from c
union
select a.col from d
union
select a.col from e
) t2
where t1.col<>t2.col;
dic.col不在a, b, c, d, e表里的dic记录吧