> ## Documentation Index
> Fetch the complete documentation index at: https://docs.firebolt.io/llms.txt
> Use this file to discover all available pages before exploring further.

> Reference material for DENSE_RANK function

# DENSE_RANK OVER

Rank the current row within the requested window.

For more information on usage, please refer to [Window Functions](/reference-sql/functions-reference/window).

## Syntax

```sql theme={"theme":{"light":"css-variables","dark":"css-variables"}}
DENSE_RANK() OVER ([PARTITION BY <partition_by>] ORDER BY <order_by> [ASC|DESC] )
```

## Parameters

| Parameter | Description | Supported input types |
| :- | :- | :- |
| `<partition_by>` | The expression used for the `PARTITION BY` clause. | Any |
| `<order_by>` | The expression used in the `ORDER BY` clause. This parameter determines what value will be ranked. | Any |

## Return Types

Same as input type

## Example

In this example, players are ranked by their high score within each game level. Unlike `RANK`, `DENSE_RANK` assigns consecutive ranks with no gaps — players with equal scores share the same rank and the next rank is incremented by one.

<div className="query-window">
  ```
  SELECT
      nickname,
      level,
      highscore,
      DENSE_RANK() OVER (PARTITION BY level ORDER BY highscore DESC) AS game_rank
  FROM
      (VALUES
          ('kennethpark', 9, 76),
          ('burchdenise', 9, 89),
          ('sabrina21', 9, 89),
          ('ymatthews', 9, 75)
      ) AS t(nickname, level, highscore)
  ORDER BY level, nickname;
  ```

  | nickname <span>text</span> | level <span>int</span> | highscore <span>int</span> | game\_rank <span>long</span> |
  | :- | :- | :- | :- |
  | burchdenise | 9 | 89 | 1 |
  | kennethpark | 9 | 76 | 2 |
  | sabrina21 | 9 | 89 | 1 |
  | ymatthews | 9 | 75 | 3 |

  <p><span>Rows: 4</span><span>Execution time: 2.03ms</span></p>
</div>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.