Ranking Functions (U-SQL)

 

Updated: March 10, 2017

U-SQL provides some built-in SQL-based ranking functions that return a ranking value for each row in a partition. Depending on the function that is used, some rows might receive the same value as other rows. Ranking functions are nondeterministic.

In U-SQL, ranking functions can only be used in the following syntactic contexts:

  • As a window function in a windowing expression with the OVER clause where it will calculate the value for each window partition.

Ranking functions cannot be nested.

U-SQL provides the following built-in ranking functions (follow the links for more information):

Ranking FunctionDescription
DENSE_RANKReturns the rank of rows within the partition of a window, without any gaps in the ranking.
NTILEReturns the number of the group to which the row belongs from among the groups that the windowing function has distributed the rows using an ordered partition.
RANKReturns the rank of each row within the window.
ROW_NUMBER Returns the sequential number of a row within a window.

See Also

Community Additions

ADD
Show: