For AI agents: an index of this documentation is at https://developer.rippling.com/llms.txt. Public pages have a Markdown version at the same URL with .md added.

Skip to main content
index

DENSE_RANK() Function

Use with AI:Rippling AI ChatGPT Claude Cursor

Description​

Assigns ranks to rows within a partition, with no gaps in ranking values

Syntax​

DENSE_RANK ( ) OVER ( [ partition_by_clause ]  order_by_clause  )

Notes​

  • If two or more rows have the same rank value in the same partition, each of those rows will receive the same rank
  • Include an OVER (...) clause with ORDER BY (and optional PARTITION BY) when using this as a window function.

Rewrite​

Use QUALIFY to filter on window expression results; do not use window functions in WHERE.

Example​

SELECT
id, DENSE_RANK() OVER (PARTITION BY department ORDER BY start_date) AS dr
FROM
rippling.employee.Employee;