130 lines
5.1 KiB
Plaintext
130 lines
5.1 KiB
Plaintext
[role="xpack"]
|
|
[testenv="basic"]
|
|
[[sql-functions]]
|
|
== Functions and Operators
|
|
|
|
{es-sql} provides a comprehensive set of built-in operators and functions:
|
|
|
|
* <<sql-operators, Operators>>
|
|
* <<sql-functions-aggs, Aggregate>>
|
|
** <<sql-functions-aggs-avg, AVG>>
|
|
** <<sql-functions-aggs-count, COUNT>>
|
|
** <<sql-functions-aggs-count-all, COUNT(ALL)>>
|
|
** <<sql-functions-aggs-count-distinct, COUNT(DISTINCT)>>
|
|
** <<sql-functions-aggs-first, FIRST>>
|
|
** <<sql-functions-aggs-last, LAST>>
|
|
** <<sql-functions-aggs-max, MAX>>
|
|
** <<sql-functions-aggs-min, MIN>>
|
|
** <<sql-functions-aggs-sum, SUM>>
|
|
** <<sql-functions-aggs-kurtosis, KURTOSIS>>
|
|
** <<sql-functions-aggs-mad, MAD>>
|
|
** <<sql-functions-aggs-percentile, PERCENTILE>>
|
|
** <<sql-functions-aggs-percentile-rank, PERCENTILE_RANK>>
|
|
** <<sql-functions-aggs-skewness, SKEWNESS>>
|
|
** <<sql-functions-aggs-stddev-pop, STDDEV_POP>>
|
|
** <<sql-functions-aggs-sum-squares, SUM_OF_SQUARES>>
|
|
** <<sql-functions-aggs-var-pop, VAR_POP>>
|
|
* <<sql-functions-grouping, Grouping>>
|
|
** <<sql-functions-grouping-histogram, HISTOGRAM>>
|
|
* <<sql-functions-datetime, Date-Time>>
|
|
** <<sql-functions-datetime-interval, INTERVAL>>
|
|
** <<sql-functions-current-date, CURRENT_DATE>>
|
|
** <<sql-functions-current-timestamp, CURRENT_TIMESTAMP>>
|
|
** <<sql-functions-datetime-day, DAY>>
|
|
** <<sql-functions-datetime-dow, DAY_OF_WEEK>>
|
|
** <<sql-functions-datetime-doy, DAY_OF_YEAR>>
|
|
** <<sql-functions-datetime-dayname, DAY_NAME>>
|
|
** <<sql-functions-datetime-hour, HOUR>>
|
|
** <<sql-functions-datetime-isodow, ISO_DAY_OF_WEEK>>
|
|
** <<sql-functions-datetime-isoweek, ISO_WEEK_OF_YEAR>>
|
|
** <<sql-functions-datetime-minuteofday, MINUTE_OF_DAY>>
|
|
** <<sql-functions-datetime-minute, MINUTE_OF_HOUR>>
|
|
** <<sql-functions-datetime-month, MONTH_OF_YEAR>>
|
|
** <<sql-functions-datetime-monthname, MONTH_NAME>>
|
|
** <<sql-functions-now, NOW>>
|
|
** <<sql-functions-datetime-second, SECOND_OF_MINUTE>>
|
|
** <<sql-functions-datetime-quarter, QUARTER>>
|
|
** <<sql-functions-today, TODAY>>
|
|
** <<sql-functions-datetime-week, WEEK_OF_YEAR>>
|
|
** <<sql-functions-datetime-year, YEAR>>
|
|
** <<sql-functions-datetime-extract, EXTRACT>>
|
|
* <<sql-functions-search, Full-Text Search>>
|
|
** <<sql-functions-search-match, MATCH>>
|
|
** <<sql-functions-search-query, QUERY>>
|
|
** <<sql-functions-search-score, SCORE>>
|
|
* <<sql-functions-math, Mathematical>>
|
|
** <<sql-functions-math-abs, ABS>>
|
|
** <<sql-functions-math-cbrt, CBRT>>
|
|
** <<sql-functions-math-ceil, CEIL>>
|
|
** <<sql-functions-math-e, E>>
|
|
** <<sql-functions-math-exp, EXP>>
|
|
** <<sql-functions-math-expm1, EXPM1>>
|
|
** <<sql-functions-math-floor, FLOOR>>
|
|
** <<sql-functions-math-log, LOG>>
|
|
** <<sql-functions-math-log10, LOG10>>
|
|
** <<sql-functions-math-pi, PI>>
|
|
** <<sql-functions-math-power, POWER>>
|
|
** <<sql-functions-math-random, RANDOM>>
|
|
** <<sql-functions-math-round, ROUND>>
|
|
** <<sql-functions-math-sign, SIGN>>
|
|
** <<sql-functions-math-sqrt, SQRT>>
|
|
** <<sql-functions-math-truncate, TRUNCATE>>
|
|
** <<sql-functions-math-acos, ACOS>>
|
|
** <<sql-functions-math-asin, ASIN>>
|
|
** <<sql-functions-math-atan, ATAN>>
|
|
** <<sql-functions-math-atan2, ATAN2>>
|
|
** <<sql-functions-math-cos, COS>>
|
|
** <<sql-functions-math-cosh, COSH>>
|
|
** <<sql-functions-math-cot, COT>>
|
|
** <<sql-functions-math-degrees, DEGREES>>
|
|
** <<sql-functions-math-radians, RADIANS>>
|
|
** <<sql-functions-math-sin, SIN>>
|
|
** <<sql-functions-math-sinh, SINH>>
|
|
** <<sql-functions-math-tan, TAN>>
|
|
* <<sql-functions-string, String>>
|
|
** <<sql-functions-string-ascii, ASCII>>
|
|
** <<sql-functions-string-bit-length, BIT_LENGTH>>
|
|
** <<sql-functions-string-char, CHAR>>
|
|
** <<sql-functions-string-char-length, CHAR_LENGTH>>
|
|
** <<sql-functions-string-concat, CONCAT>>
|
|
** <<sql-functions-string-insert, INSERT>>
|
|
** <<sql-functions-string-lcase, LCASE>>
|
|
** <<sql-functions-string-left, LEFT>>
|
|
** <<sql-functions-string-length, LENGTH>>
|
|
** <<sql-functions-string-locate, LOCATE>>
|
|
** <<sql-functions-string-ltrim, LTRIM>>
|
|
** <<sql-functions-string-octet-length, OCTET_LENGTH>>
|
|
** <<sql-functions-string-position, POSITION>>
|
|
** <<sql-functions-string-repeat, REPEAT>>
|
|
** <<sql-functions-string-replace, REPLACE>>
|
|
** <<sql-functions-string-right, RIGHT>>
|
|
** <<sql-functions-string-rtrim, RTRIM>>
|
|
** <<sql-functions-string-space, SPACE>>
|
|
** <<sql-functions-string-substring, SUBSTRING>>
|
|
** <<sql-functions-string-ucase, UCASE>>
|
|
* <<sql-functions-type-conversion, Type Conversion>>
|
|
** <<sql-functions-type-conversion-cast, CAST>>
|
|
** <<sql-functions-type-conversion-convert, CONVERT>>
|
|
* <<sql-functions-conditional, Conditional>>
|
|
** <<sql-functions-conditional-coalesce, COALESCE>>
|
|
** <<sql-functions-conditional-greatest, GREATEST>>
|
|
** <<sql-functions-conditional-ifnull, IFNULL>>
|
|
** <<sql-functions-conditional-isnull, ISNULL>>
|
|
** <<sql-functions-conditional-least, LEAST>>
|
|
** <<sql-functions-conditional-nullif, NULLIF>>
|
|
** <<sql-functions-conditional-nvl, NVL>>
|
|
* <<sql-functions-system, System>>
|
|
** <<sql-functions-system-database, DATABASE>>
|
|
** <<sql-functions-system-user, USER>>
|
|
|
|
include::operators.asciidoc[]
|
|
include::aggs.asciidoc[]
|
|
include::grouping.asciidoc[]
|
|
include::date-time.asciidoc[]
|
|
include::search.asciidoc[]
|
|
include::math.asciidoc[]
|
|
include::string.asciidoc[]
|
|
include::type-conversion.asciidoc[]
|
|
include::conditional.asciidoc[]
|
|
include::system.asciidoc[]
|