读一条emp的记录,判断是否存在emp.deptno=dept.deptno的记录。如果存在,则显示select emp.empno,emp.ename,emp.job,emp.sal
from scott.emp,scott.dept where emp.deptno=当前deptno然后再读下一条直至记录结束
from scott.emp,scott.dept where emp.deptno=当前deptno然后再读下一条直至记录结束
解决方案 »
- 简单的说下oracle的database link
- 如何减小表空间大小?
- VC+OO4O连接Oracle 10g数据库,如何打包才能在不装oracle 客户端的客户机上连接成功
- SQL语句特殊符号的处理问题
- 存储过程,更新表时“表或视图不存在”。
- 语句执行的速度太慢了,有什么办法可以提高一下?
- sql 调用 自定义function,出现问题。
- 我也是sql问题,在线等待答案。
- 如何把一个文本文件倒入Oracle8.0
- 请教高手:怎样往分区表中追加数据?而数据取之于同一分区表中的另一分区?(急急!在线等待)
- 怎么解决null与0同时存在的除法问题?
- 如果增加 Oracle9i 的编码,100分!
from scott.emp,scott.dept
where ...
select emp.empno,emp.ename,emp.job,emp.sal
from scott.emp,scott.dept
where scott.emp.deptno=scott.dept.deptno;
这种没有必要用Exists
先执行(select * from scott.emp where scott.emp.deptno=scott.dept.deptno);
然后根据这条语句返回的记录个数n去执行select emp.empno,emp.ename,emp.job,emp.sal
from scott.emp,scott.dept,所以该语句执行后会返回记录个数n个重复的 结果。
应该直接执行:
select emp.empno,emp.ename,emp.job,emp.sal
from scott.emp,scott.dept
where scott.emp.deptno=scott.dept.deptno;