﻿---
title: ES|QL grouping functions
description: The STATS command supports these grouping functions: The INLINE STATS command supports these grouping functions: BUCKET, TBUCKET. 
url: https://www.elastic.co/elastic/docs-builder/docs/3016/reference/query-languages/esql/functions-operators/grouping-functions
products:
  - Elasticsearch
applies_to:
  - Elastic Cloud Serverless: Generally available
  - Elastic Stack: Generally available
---

# ES|QL grouping functions
The [`STATS`](https://www.elastic.co/elastic/docs-builder/docs/3016/reference/query-languages/esql/commands/stats-by) command supports these grouping functions:
- [`BUCKET`](https://www.elastic.co/elastic/docs-builder/docs/3016/reference/query-languages/esql/functions-operators/grouping-functions/bucket)
- [`CATEGORIZE`](https://www.elastic.co/elastic/docs-builder/docs/3016/reference/query-languages/esql/functions-operators/grouping-functions/categorize) <applies-to>Elastic Stack: Preview since 9.0</applies-to> <applies-to>Elastic Stack: Generally available since 9.1</applies-to>
- [`TBUCKET`](https://www.elastic.co/elastic/docs-builder/docs/3016/reference/query-languages/esql/functions-operators/grouping-functions/tbucket) <applies-to>Elastic Stack: Generally available since 9.2</applies-to>

The [`INLINE STATS`](https://www.elastic.co/elastic/docs-builder/docs/3016/reference/query-languages/esql/commands/inlinestats-by) command supports these grouping functions:
- [`BUCKET`](https://www.elastic.co/elastic/docs-builder/docs/3016/reference/query-languages/esql/functions-operators/grouping-functions/bucket)
- [`TBUCKET`](https://www.elastic.co/elastic/docs-builder/docs/3016/reference/query-languages/esql/functions-operators/grouping-functions/tbucket)