Oracle中的with as的查询
来源:互联网 发布:域名需要多少钱 编辑:程序博客网 时间:2024/04/30 06:04
with as查询功能还是比较有用的,看下面的例子:
with t as
(select 'a' f1,1 f2,'aa' f3 from dual
union
select 'a' ,2 ,'bb' from dual
union
select 'a' ,3 ,'cc' from dual)
select distinct f1,max(f2) over(partition by f1 ) f2 ,max(f3) over(partition by f1 )f3 from t
这个例子是使用:
(select 'a' f1,1 f2,'aa' f3 from dual
union
select 'a' ,2 ,'bb' from dual
union
select 'a' ,3 ,'cc' from dual)
作为被查询的表格,后面紧跟着查询语句:
select distinct f1,max(f2) over(partition by f1 ) f2 ,max(f3) over(partition by f1 )f3 from t
这样的SQL可以在不使用临时表或者视图的时候快速的进行查询结果集再次查询。
- Oracle中的with as的查询
- 关于Oracle中的as和with as 的用法
- oracle 子查询因子化 with as
- oracle with as子查询用法
- Oracle 使用 with as 优化重复查询
- with..as oracle的用法
- oracle 的 with as 用法
- ORACLE WITH AS 的用法
- oracle with as 的用法
- with..as oracle的用法
- with as 级联查询
- WITH AS 子查询
- with as (子查询)
- oracle和sql的with as 语句
- oracle with as语句的DDL尴尬
- 关于oracle with table as的用法
- ORACLE 中 WITH AS 的用法
- oracle中with as语句的使用
- 工作流(Workflow)和BPM的不同
- 又。。。。。。北上。。。。。。
- 关于destroyApp(参数)问题
- 微软20日将启动反盗版验证
- ORA-01078 和 LRM-00109 以及后续的问题
- Oracle中的with as的查询
- linux下ORACLE10g自启动设置
- 使用正规表达式编写更好的 SQL
- 转包合同
- 2008年10月21日预测
- sql生成随机数随机字符
- TCP实现P2P通信、TCP穿越NAT的方法、TCP打洞
- VC6.0从键盘输入文件结符
- scanf的研究