OpenSearch/docs/reference/sql
Marios Trivyzas 4710a7472f
SQL: Implement FIRST/LAST aggregate functions (#37936)
FIRST and LAST can be used with one argument and work similarly to MIN
and MAX but they are implemented using a Top Hits aggregation and
therefore can also operate on keyword fields. When a second argument is
provided then they return the first/last value of the first arg when its
values are ordered ascending/descending (respectively) by the values of
the second argument. Currently because of the usage of a Top Hits
aggregation FIRST and LAST cannot be used in the HAVING clause of a
GROUP BY query to filter on the results of the aggregation.

Closes: #35639
2019-01-31 16:33:05 +02:00
..
appendix SQL: documentation improvements and updates (#36918) 2018-12-21 23:25:54 +02:00
endpoints SQL: Added SSL configuration options tests (#37875) 2019-01-31 10:52:49 +02:00
functions SQL: Implement FIRST/LAST aggregate functions (#37936) 2019-01-31 16:33:05 +02:00
language SQL: Introduce SQL DATE data type (#37693) 2019-01-24 13:41:58 +02:00
concepts.asciidoc SQL: documentation improvements and updates (#36918) 2018-12-21 23:25:54 +02:00
getting-started.asciidoc SQL: [docs] Add `beta[]` markup to all SQL pages (#36471) 2018-12-11 13:25:29 +02:00
index.asciidoc Move ODBC documentation to `elasticsearch` repository (#36955) 2018-12-27 11:55:20 +02:00
limitations.asciidoc SQL: Implement FIRST/LAST aggregate functions (#37936) 2019-01-31 16:33:05 +02:00
overview.asciidoc [DOCS] Various spelling corrections (#37046) 2019-01-07 14:44:12 +01:00
security.asciidoc SQL: [docs] Add `beta[]` markup to all SQL pages (#36471) 2018-12-11 13:25:29 +02:00