2023-10-17 23:36:14 +08:00
|
|
|
[discrete]
|
2023-06-06 00:38:55 +08:00
|
|
|
[[esql-where]]
|
|
|
|
=== `WHERE`
|
|
|
|
|
2023-11-06 15:42:13 +08:00
|
|
|
**Syntax**
|
|
|
|
|
|
|
|
[source,esql]
|
|
|
|
----
|
|
|
|
WHERE expression
|
|
|
|
----
|
|
|
|
|
|
|
|
*Parameters*
|
|
|
|
|
|
|
|
`expression`::
|
|
|
|
A boolean expression.
|
|
|
|
|
|
|
|
*Description*
|
|
|
|
|
|
|
|
The `WHERE` processing command produces a table that contains all the rows from
|
|
|
|
the input table for which the provided condition evaluates to `true`.
|
|
|
|
|
|
|
|
`WHERE` supports various <<esql-functions,functions>> and
|
|
|
|
<<esql-operators,operators>>.
|
|
|
|
|
|
|
|
*Examples*
|
2023-06-06 00:38:55 +08:00
|
|
|
|
|
|
|
[source,esql]
|
|
|
|
----
|
|
|
|
include::{esql-specs}/docs.csv-spec[tag=where]
|
|
|
|
----
|
|
|
|
|
|
|
|
Which, if `still_hired` is a boolean field, can be simplified to:
|
|
|
|
|
|
|
|
[source,esql]
|
|
|
|
----
|
|
|
|
include::{esql-specs}/docs.csv-spec[tag=whereBoolean]
|
|
|
|
----
|
|
|
|
|
2023-11-06 15:42:13 +08:00
|
|
|
Using a function:
|
2023-06-06 00:38:55 +08:00
|
|
|
|
|
|
|
[source,esql]
|
|
|
|
----
|
|
|
|
include::{esql-specs}/docs.csv-spec[tag=whereFunction]
|
|
|
|
----
|