2018-06-22 18:40:25 -04:00
|
|
|
[role="xpack"]
|
|
|
|
[testenv="basic"]
|
2017-12-13 10:19:31 -05:00
|
|
|
[[sql-functions]]
|
|
|
|
== Functions and Operators
|
|
|
|
|
2018-09-05 18:19:49 -04:00
|
|
|
{es-sql} provides a comprehensive set of built-in operators and functions:
|
|
|
|
|
|
|
|
* <<sql-operators, Operators>>
|
2019-04-01 11:01:03 -04:00
|
|
|
** <<sql-operators-equality>>
|
|
|
|
** <<sql-operators-null-safe-equality>>
|
|
|
|
** <<sql-operators-inequality>>
|
|
|
|
** <<sql-operators-comparison>>
|
|
|
|
** <<sql-operators-between>>
|
|
|
|
** <<sql-operators-is-null>>
|
|
|
|
** <<sql-operators-in>>
|
|
|
|
** <<sql-operators-and>>
|
|
|
|
** <<sql-operators-or>>
|
|
|
|
** <<sql-operators-not>>
|
|
|
|
** <<sql-operators-plus>>
|
|
|
|
** <<sql-operators-subtract>>
|
|
|
|
** <<sql-operators-negate>>
|
|
|
|
** <<sql-operators-multiply>>
|
|
|
|
** <<sql-operators-divide>>
|
|
|
|
** <<sql-operators-remainder>>
|
|
|
|
** <<sql-operators-cast-cast>>
|
|
|
|
* <<sql-like-rlike-operators>>
|
|
|
|
** <<sql-like-operator>>
|
|
|
|
** <<sql-rlike-operator>>
|
|
|
|
* <<sql-functions-aggs>>
|
2019-03-28 08:28:07 -04:00
|
|
|
** <<sql-functions-aggs-avg>>
|
|
|
|
** <<sql-functions-aggs-count>>
|
|
|
|
** <<sql-functions-aggs-count-all>>
|
|
|
|
** <<sql-functions-aggs-count-distinct>>
|
|
|
|
** <<sql-functions-aggs-first>>
|
|
|
|
** <<sql-functions-aggs-last>>
|
|
|
|
** <<sql-functions-aggs-max>>
|
|
|
|
** <<sql-functions-aggs-min>>
|
|
|
|
** <<sql-functions-aggs-sum>>
|
|
|
|
** <<sql-functions-aggs-kurtosis>>
|
|
|
|
** <<sql-functions-aggs-mad>>
|
|
|
|
** <<sql-functions-aggs-percentile>>
|
|
|
|
** <<sql-functions-aggs-percentile-rank>>
|
|
|
|
** <<sql-functions-aggs-skewness>>
|
|
|
|
** <<sql-functions-aggs-stddev-pop>>
|
|
|
|
** <<sql-functions-aggs-sum-squares>>
|
|
|
|
** <<sql-functions-aggs-var-pop>>
|
2019-04-01 11:01:03 -04:00
|
|
|
* <<sql-functions-grouping>>
|
2019-03-28 08:28:07 -04:00
|
|
|
** <<sql-functions-grouping-histogram>>
|
2019-04-01 11:01:03 -04:00
|
|
|
* <<sql-functions-datetime-interval, Date-Time Operators>>
|
|
|
|
* <<sql-functions-current-date, Date-Time Functions>>
|
2019-03-28 08:28:07 -04:00
|
|
|
** <<sql-functions-current-date>>
|
2019-04-03 13:35:37 -04:00
|
|
|
** <<sql-functions-current-time>>
|
2019-03-28 08:28:07 -04:00
|
|
|
** <<sql-functions-current-timestamp>>
|
|
|
|
** <<sql-functions-datetime-day>>
|
|
|
|
** <<sql-functions-datetime-dow>>
|
|
|
|
** <<sql-functions-datetime-doy>>
|
|
|
|
** <<sql-functions-datetime-dayname>>
|
|
|
|
** <<sql-functions-datetime-hour>>
|
|
|
|
** <<sql-functions-datetime-isodow>>
|
|
|
|
** <<sql-functions-datetime-isoweek>>
|
|
|
|
** <<sql-functions-datetime-minuteofday>>
|
|
|
|
** <<sql-functions-datetime-minute>>
|
|
|
|
** <<sql-functions-datetime-month>>
|
|
|
|
** <<sql-functions-datetime-monthname>>
|
|
|
|
** <<sql-functions-now>>
|
|
|
|
** <<sql-functions-datetime-second>>
|
|
|
|
** <<sql-functions-datetime-quarter>>
|
|
|
|
** <<sql-functions-today>>
|
|
|
|
** <<sql-functions-datetime-week>>
|
|
|
|
** <<sql-functions-datetime-year>>
|
|
|
|
** <<sql-functions-datetime-extract>>
|
2019-04-01 11:01:03 -04:00
|
|
|
* <<sql-functions-search>>
|
2019-03-28 08:28:07 -04:00
|
|
|
** <<sql-functions-search-match>>
|
|
|
|
** <<sql-functions-search-query>>
|
|
|
|
** <<sql-functions-search-score>>
|
2019-04-01 11:01:03 -04:00
|
|
|
* <<sql-functions-math>>
|
2019-03-28 08:28:07 -04:00
|
|
|
** <<sql-functions-math-abs>>
|
|
|
|
** <<sql-functions-math-cbrt>>
|
|
|
|
** <<sql-functions-math-ceil>>
|
|
|
|
** <<sql-functions-math-e>>
|
|
|
|
** <<sql-functions-math-exp>>
|
|
|
|
** <<sql-functions-math-expm1>>
|
|
|
|
** <<sql-functions-math-floor>>
|
|
|
|
** <<sql-functions-math-log>>
|
|
|
|
** <<sql-functions-math-log10>>
|
|
|
|
** <<sql-functions-math-pi>>
|
|
|
|
** <<sql-functions-math-power>>
|
|
|
|
** <<sql-functions-math-random>>
|
|
|
|
** <<sql-functions-math-round>>
|
|
|
|
** <<sql-functions-math-sign>>
|
|
|
|
** <<sql-functions-math-sqrt>>
|
|
|
|
** <<sql-functions-math-truncate>>
|
|
|
|
** <<sql-functions-math-acos>>
|
|
|
|
** <<sql-functions-math-asin>>
|
|
|
|
** <<sql-functions-math-atan>>
|
|
|
|
** <<sql-functions-math-atan2>>
|
|
|
|
** <<sql-functions-math-cos>>
|
|
|
|
** <<sql-functions-math-cosh>>
|
|
|
|
** <<sql-functions-math-cot>>
|
|
|
|
** <<sql-functions-math-degrees>>
|
|
|
|
** <<sql-functions-math-radians>>
|
|
|
|
** <<sql-functions-math-sin>>
|
|
|
|
** <<sql-functions-math-sinh>>
|
|
|
|
** <<sql-functions-math-tan>>
|
2019-04-01 11:01:03 -04:00
|
|
|
* <<sql-functions-string>>
|
2019-03-28 08:28:07 -04:00
|
|
|
** <<sql-functions-string-ascii>>
|
|
|
|
** <<sql-functions-string-bit-length>>
|
|
|
|
** <<sql-functions-string-char>>
|
|
|
|
** <<sql-functions-string-char-length>>
|
|
|
|
** <<sql-functions-string-concat>>
|
|
|
|
** <<sql-functions-string-insert>>
|
|
|
|
** <<sql-functions-string-lcase>>
|
|
|
|
** <<sql-functions-string-left>>
|
|
|
|
** <<sql-functions-string-length>>
|
|
|
|
** <<sql-functions-string-locate>>
|
|
|
|
** <<sql-functions-string-ltrim>>
|
|
|
|
** <<sql-functions-string-octet-length>>
|
|
|
|
** <<sql-functions-string-position>>
|
|
|
|
** <<sql-functions-string-repeat>>
|
|
|
|
** <<sql-functions-string-replace>>
|
|
|
|
** <<sql-functions-string-right>>
|
|
|
|
** <<sql-functions-string-rtrim>>
|
|
|
|
** <<sql-functions-string-space>>
|
|
|
|
** <<sql-functions-string-substring>>
|
|
|
|
** <<sql-functions-string-ucase>>
|
2019-04-01 11:01:03 -04:00
|
|
|
* <<sql-functions-type-conversion>>
|
2019-03-28 08:28:07 -04:00
|
|
|
** <<sql-functions-type-conversion-cast>>
|
|
|
|
** <<sql-functions-type-conversion-convert>>
|
2019-04-01 11:01:03 -04:00
|
|
|
* <<sql-functions-conditional>>
|
2019-04-22 12:26:15 -04:00
|
|
|
** <<sql-functions-conditional-case>>
|
2019-03-28 08:28:07 -04:00
|
|
|
** <<sql-functions-conditional-coalesce>>
|
|
|
|
** <<sql-functions-conditional-greatest>>
|
|
|
|
** <<sql-functions-conditional-ifnull>>
|
|
|
|
** <<sql-functions-conditional-isnull>>
|
|
|
|
** <<sql-functions-conditional-least>>
|
|
|
|
** <<sql-functions-conditional-nullif>>
|
|
|
|
** <<sql-functions-conditional-nvl>>
|
2019-04-01 11:01:03 -04:00
|
|
|
* <<sql-functions-system>>
|
2019-03-28 08:28:07 -04:00
|
|
|
** <<sql-functions-system-database>>
|
|
|
|
** <<sql-functions-system-user>>
|
2018-09-05 18:19:49 -04:00
|
|
|
|
|
|
|
include::operators.asciidoc[]
|
2019-04-01 11:01:03 -04:00
|
|
|
include::like-rlike.asciidoc[]
|
2018-09-05 18:19:49 -04:00
|
|
|
include::aggs.asciidoc[]
|
2018-12-14 11:20:37 -05:00
|
|
|
include::grouping.asciidoc[]
|
2018-09-05 18:19:49 -04:00
|
|
|
include::date-time.asciidoc[]
|
|
|
|
include::search.asciidoc[]
|
|
|
|
include::math.asciidoc[]
|
|
|
|
include::string.asciidoc[]
|
|
|
|
include::type-conversion.asciidoc[]
|
2018-11-20 19:43:05 -05:00
|
|
|
include::conditional.asciidoc[]
|
2018-11-28 08:20:04 -05:00
|
|
|
include::system.asciidoc[]
|