請教大師oracle的with as子句的問題
with as語法–針對一個別名with tmp as (select * from tb_name)–針對多個別名withtmp as (select * from tb_name),tmp2 as (select * from tb_name2),tmp3 as (select * from tb_name3),其實就是把一大堆重復用到的sql語句放在with as里面,取一個別名,后面的查詢就可以用它,這樣對于大批量的sql語句起到一個優化的作用,而且清楚明了。
舉例:1with e as (select * from * e where *=7499)select * from e;2withs1 as (select rownum c1 from dual connect by rownum <= 10),s2 as (select rownum c2 from dual connect by rownum <= 10)select a.c1, b.c2 from s1 a, s2 b where。;。
oracel 多個with as 嵌套的語句怎么優化
with as語法
–針對一個別名
with tmp as (select * from tb_name)
–針對多個別名
with
tmp as (select * from tb_name),
tmp2 as (select * from tb_name2),
tmp3 as (select * from tb_name3),
其實就是把一大堆重復用到的sql語句放在with as里面,取一個別名,后面的查詢就可以用它,這樣對于大批量的sql語句起到一個優化的作用,而且清楚明了。
舉例:
1
with e as (select * from * e where *=7499)
select * from e;
2
with
s1 as (select rownum c1 from dual connect by rownum
轉載請注明出處華閱文章網 » oraclewithas語句