## 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

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;

#### 学习tf.sparse_to_dense函数（代码实现）

2017-05-01 16:26:21

#### rank,dense_rank,row_number使用和区别

2009-06-19 17:30:00

#### python keras （一个超好用的神经网络框架）的使用以及实例

2015-09-20 17:18:59

#### 【TensorFlow】tf.sparse_to_dense的用法

2016-11-27 20:37:32

#### python科学计算六：scipy矩阵操作

2013-12-23 12:01:18

#### Keras中几个重要函数用法

2017-04-28 09:13:41

#### 系统学习深度学习（二十）--ResNet,DenseNet,以及残差家族

2017-03-15 13:19:15

#### tensorflow——tf.one_hot以及tf.sparse_to_dense函数

2017-08-04 20:47:31

#### Oracle分析函数之Rank()和DENSE_RANK()详解

2015-01-04 14:07:43

#### Oracle-分析函数之排序值rank()和dense_rank()

2016-11-04 20:16:01