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

# COUNT OVER

Count the number of values 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"}}
COUNT( <value> ) OVER ( [ PARTITION BY <partition_by> ] )
```

## Parameters

| Parameter        | Description                                       | Supported input types |
| :--------------- | :------------------------------------------------ | :-------------------- |
| `<value>`        | A value used for the `COUNT()` function.          | Any numeric type      |
| `<partition_by>` | An expression used for the `PARTITION BY` clause. | Any                   |

## Return Type

`NUMERIC`

## Example

The following example counts how many players registered on each day by using `COUNT` as a window function partitioned by registration date.

<div className="query-window">
  ```
  SELECT
      registeredon,
      agecategory,
      COUNT(agecategory) OVER (PARTITION BY registeredon) AS count_of_players
  FROM
      (VALUES
          ('2020-11-15'::DATE, 'Junior'),
          ('2020-11-15'::DATE, 'Senior'),
          ('2020-11-15'::DATE, 'Adult'),
          ('2020-11-16'::DATE, 'Junior'),
          ('2020-11-16'::DATE, 'Adult')
      ) AS t(registeredon, agecategory)
  ORDER BY registeredon, agecategory;
  ```

  | registeredon <span>date</span> | agecategory <span>text</span> | count\_of\_players <span>long</span> |
  | :----------------------------- | :---------------------------- | :----------------------------------- |
  | 2020-11-15                     | Adult                         | 3                                    |
  | 2020-11-15                     | Junior                        | 3                                    |
  | 2020-11-15                     | Senior                        | 3                                    |
  | 2020-11-16                     | Adult                         | 2                                    |
  | 2020-11-16                     | Junior                        | 2                                    |

  <p><span>Rows: 5</span><span>Execution time: 2.39ms</span></p>
</div>
