1.查询语句的使用
1.1相关子查询
.where中可以包含一个select语句的子查询
.where中可以包含in,exists语句
.最多可以嵌套16层
1.2外连接
SQL> select a.* , b.skill from students a,student_skill b where a.st_id=b.st_id(+)
order by a.st_id;
1.3自我连接
SQL> select e1.ename||' work for '||e2.ename "Employees and their Managers"
from scott.emp e1,scott.emp e2 where e1.mgr=e2.empno;
1.4UNION , INTERSECT及 MINUS
UNION: 可以将两个以上的表的相类似的查询结果放在一起 (union all则表示返回所有的行)
具体语法:
select ...
union[all]
阅读全文>
发表于 @ 2008年07月09日 10:55:00|评论(loading...)|编辑|收藏