这一篇是对前面所有关于分析函数的文章的总结:
一、统计方面:
复制代码 代码如下:
sum() over ([partition by ] [order by ])
sum() over ([partition by ] [order by ]
rows between preceding and following)
sum() over ([partition by ] [order by ]
rows between preceding and current row)
sum() over ([partition by ] [order by ]
range between interval ” ‘day’ preceding
and interval ” ‘day’ following )
sum() over ([partition by ] [order by ]
rows between preceding and following)
sum() over ([partition by ] [order by ]
rows between preceding and current row)
sum() over ([partition by ] [order by ]
range between interval ” ‘day’ preceding
and interval ” ‘day’ following )
具体请参考《oracle开发之分析函数简介over用法》和《oracle开发之窗口函数》
二、排列方面:
复制代码 代码如下:
rank() over ([partition by ] [order by ] [nulls first/last])
dense_rank() over ([patition by ] [order by ] [nulls first/last])
row_number() over ([partitionby ] [order by ] [nulls first/last])
ntile() over ([partition by ] [order by ])
dense_rank() over ([patition by ] [order by ] [nulls first/last])
row_number() over ([partitionby ] [order by ] [nulls first/last])
ntile() over ([partition by ] [order by ])
具体请参考《oracle开发之分析函数(rank, dense_rank, row_number)》
三、最大值/最小值查找方面:
复制代码 代码如下:
min()/max() keep (dense_rank first/last [partition by ] [order by ])
具体请参考《oracle开发之分析函数(top/bottom n、first/last、ntile)》
四、首记录/末记录查找方面:
复制代码 代码如下:
first_value / last_value(sum() over ([patition by ] [order by ]
rows between preceding and following ))
rows between preceding and following ))
具体请参考《oracle开发之窗口函数》
五、相邻记录之间比较方面:
复制代码 代码如下:
lag(sum(), 1) over([patition by ] [order by ])
具体请参考《oracle开发之报表函数》
以上就是oracle分析函数总结的全部内容,希望能给大家一个参考,也希望大家多多支持<计算机技术网(www.ctvol.com)!!>。
需要了解更多数据库技术:Oracle开发之分析函数总结,都可以关注数据库技术分享栏目—计算机技术网(www.ctvol.com)!
本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。
ctvol管理联系方式QQ:251552304
本文章地址:https://www.ctvol.com/dtteaching/803896.html