where.asciidoc 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. [discrete]
  2. [[esql-where]]
  3. === `WHERE`
  4. **Syntax**
  5. [source,esql]
  6. ----
  7. WHERE expression
  8. ----
  9. *Parameters*
  10. `expression`::
  11. A boolean expression.
  12. *Description*
  13. The `WHERE` processing command produces a table that contains all the rows from
  14. the input table for which the provided condition evaluates to `true`.
  15. *Examples*
  16. [source,esql]
  17. ----
  18. include::{esql-specs}/docs.csv-spec[tag=where]
  19. ----
  20. Which, if `still_hired` is a boolean field, can be simplified to:
  21. [source,esql]
  22. ----
  23. include::{esql-specs}/docs.csv-spec[tag=whereBoolean]
  24. ----
  25. `WHERE` supports various <<esql-functions,functions>>. For example the
  26. <<esql-length>> function:
  27. [source,esql]
  28. ----
  29. include::{esql-specs}/docs.csv-spec[tag=whereFunction]
  30. ----
  31. For a complete list of all functions, refer to <<esql-functions>>.
  32. include::../functions/predicates.asciidoc[tag=body]
  33. include::../functions/like.asciidoc[tag=body]
  34. include::../functions/rlike.asciidoc[tag=body]
  35. include::../functions/in.asciidoc[tag=body]
  36. For a complete list of all operators, refer to <<esql-operators>>.