﻿---
title: ES|QL SAMPLE command
description: 
url: https://www.elastic.co/elastic/docs-builder/docs/3016/reference/query-languages/esql/commands/sample
products:
  - Elasticsearch
---

# ES|QL SAMPLE command
<applies-to>
  - Elastic Cloud Serverless: Preview
  - Elastic Stack: Preview since 9.1
</applies-to>

The `SAMPLE` command samples a fraction of the table rows.

## Syntax

```esql
SAMPLE probability
```


## Parameters

<definitions>
  <definition term="probability">
    The probability that a row is included in the sample. The value must be between 0 and 1, exclusive.
  </definition>
</definitions>


## Examples

```esql
FROM employees
| KEEP emp_no
| SAMPLE 0.05
```


| emp_no:integer |
|----------------|
| 10018          |
| 10024          |
| 10062          |
| 10081          |