|
原帖由 orazrael 于 2009-1-2 00:14 发表 ![]()
5.最后一个with子句与下面的查询之间不能有逗号,只通过右括号分割,查询必须用括号括起来
目的是为了重用查询。
语法:
With alias_name as (select1),
With alias_name2 as (select2),
…
With alias_namen as (select n)
Select ….
1 with a1 as (select empno,ename,sal from emp where deptno=10),
2 with b1 as (select empno,ename,sal from emp where deptno=30)
3* select * from a1,b1
idle> /
with b1 as (select empno,ename,sal from emp where deptno=30)
*
第 2 行出现错误:
ORA-00903: 表名无效
不能用两个哦..
ok,第2个开始没有with,多写了!
而且如果在with中定义了查询,在子查询中不使用是不可以的 |
|