oracle--with as

with as把一段查询结果放在临时表,后面的查询中可多次使用

语法:

with 别名 as(select * from table)

with 别名1 as(select * from table1),

   .............

   别名n as(select * from tablen)

 

示例:

with 别名 as(select * from table where ....)
select * from 别名

ps:使用with as最后的select返回不能不写啊!!!!

posted @ 2016-06-16 12:01  未来的那啥  阅读(303)  评论(0编辑  收藏  举报