分析函数-DENSE_RANK
来源:互联网 发布:淘宝助理下载与安装 编辑:程序博客网 时间:2024/06/16 13:29
Analytic Syntax(分析语法)
Aggregate Syntax(聚集语法)
Purpose
DENSE_RANK computes the rank of a row in an ordered group of rows and returns the rank as a NUMBER. The ranks are consecutive(连续的) integers beginning with 1. The largest rank value is the number of unique values returned by the query. Rank values are not skipped in the event of ties(结). Rows with equal values for the ranking criteria(条件) receive the same rank. This function is useful for top-N and bottom-N reporting.
This function accepts as arguments any numeric datatype and returns NUMBER.
As an aggregate function, DENSE_RANK calculates the dense(密集的) rank of a hypothetical(假设的) row identified by the arguments of the function with respect to a given sort specification(规格). The arguments of the function must all evaluate to constant expressions within each aggregate group, because they identify a single row within each group. The constant argument expressions and the expressions in the order_by_clause of the aggregate match by position. Therefore, the number of arguments must be the same and types must be compatible.
As an analytic function, DENSE_RANK computes the rank of each row returned from a query with respect to the other rows, based on the values of the value_exprs in the order_by_clause.
Analytic Example
返回各部门工资排名前三位的员工(6.5)
SELECT deptno,ename,sal FROM( SELECT deptno,ename,sal, DENSE_RANK() OVER(PARTITION BY deptno ORDER BY sal DESC) AS dense_rank -- DENSE_rank分析函数,PARTITION分组子句 FROM scott.emp ORDER BY 1,3 DESC) WHERE dense_rank<=3;
- 分析函数-DENSE_RANK
- oracle 分析函数dense_rank()
- Oracle:分析函数2(Rank, Dense_rank, row_number)
- 分析函数(ROW_NUMBER、RANK、DENSE_RANK)的用法
- 分析函数2(Rank, Dense_rank, row_number) 【转】
- oracle分析函数(rank(),dense_rank(),row_number())
- oracle分析函数Rank, Dense_rank, row_number
- oracle 分析函数Rank, Dense_rank, row_number
- oracle分析函数Rank, Dense_rank, row_number
- oracle分析函数Rank, Dense_rank, row_number
- oracle分析函数Rank, Dense_rank, row_number
- ORACLE分析函数(3)---rank,dense_rank,row_number
- 排名分析函数 rank(),dense_rank(),row_number()
- oracle 分析函数 RANK、DENSE_RANK、ROW_NUMBER
- oracle分析函数Rank, Dense_rank, row_number
- oracle分析函数Rank, Dense_rank, row_number
- oracle分析函数Rank, Dense_rank, row_number
- oracle 分析函数 keep(dense_rank first/last)
- MySQL系列第三篇:MySQL工具之SQLYog安装配置
- 自定义 Dialog
- Linux Cpu占用高调试方法
- Laravel 以ElasticSearch的方式使用scout
- Java 数组基础
- 分析函数-DENSE_RANK
- FaceBook第三方登录问题处理
- Intent、Bundle、onActivityResult传值
- Android ViewPager 和 TabPageIndicator 的限制滑动和禁用点击
- android -- 关于fragment
- angularjs学习笔记--ng-class的三种使用方法
- 在阿里云 CentOS 服务器(ECS)上搭建 nginx + mysql + php-fpm 环境
- mac下直接用brew安装的问题
- 49.Android过渡动画的一个小练习