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返回不能不写啊!!!!

原文地址:https://www.cnblogs.com/yhzh/p/5590566.html