Skip to main content

Dense Rank

Definition

The denseRank method allows you to add the DENSE_RANK function to the query. The DENSE_RANK function assigns a rank to every row in each partition of a result set.

Available methods

  • denseRank(): It does not receive any parameters.

To use this way, you need to import the static functions as follows:

import static com.myzlab.k.KFunction.*;

Example

Java code:

k
.select(
APP_USER.FIRST_NAME,
denseRank().over(wd())
)
.from(APP_USER)
.multiple();

SQL generated:

SELECT
au.first_name,
DENSE_RANK() OVER()
FROM app_user au

Parameters:

  • None