2018-06-22 18:40:25 -04:00
|
|
|
[role="xpack"]
|
|
|
|
[testenv="basic"]
|
2018-06-20 14:40:13 -04:00
|
|
|
[[sql-syntax-reserved]]
|
2018-09-28 13:17:41 -04:00
|
|
|
== Reserved keywords
|
2017-12-13 10:19:31 -05:00
|
|
|
|
|
|
|
Table with reserved keywords that need to be quoted. Also provide an example to make it more obvious.
|
|
|
|
|
2019-02-15 08:24:03 -05:00
|
|
|
The following table lists all of the keywords that are reserved in {es-sql},
|
2017-12-13 10:19:31 -05:00
|
|
|
along with their status in the SQL standard. These reserved keywords must
|
|
|
|
be quoted (using double quotes) in order to be used as an identifier, for example:
|
|
|
|
|
|
|
|
[source, sql]
|
|
|
|
----
|
|
|
|
SELECT "AS" FROM index
|
|
|
|
----
|
|
|
|
|
2018-12-21 16:25:54 -05:00
|
|
|
[cols="^,^,^"]
|
2017-12-13 10:19:31 -05:00
|
|
|
|
|
|
|
|===
|
|
|
|
|
2018-12-21 16:25:54 -05:00
|
|
|
s|Keyword
|
|
|
|
s|SQL:2016
|
|
|
|
s|SQL-92
|
2017-12-13 10:19:31 -05:00
|
|
|
|
|
|
|
|
|
|
|
|`ALL` |reserved |reserved
|
|
|
|
|`AND` |reserved |reserved
|
|
|
|
|`ANY` |reserved |reserved
|
|
|
|
|`AS` |reserved |reserved
|
|
|
|
|`ASC` |reserved |reserved
|
|
|
|
|`BETWEEN` |reserved |reserved
|
|
|
|
|`BY` |reserved |reserved
|
|
|
|
|`CAST` |reserved |reserved
|
2019-02-15 08:24:03 -05:00
|
|
|
|`CATALOG` |reserved |reserved
|
|
|
|
|`CONVERT` |reserved |reserved
|
|
|
|
|`CURRENT_DATE` |reserved |reserved
|
|
|
|
|`CURRENT_TIMESTAMP` |reserved |reserved
|
|
|
|
|`DAY` |reserved |reserved
|
|
|
|
|`DAYS` | |
|
2017-12-13 10:19:31 -05:00
|
|
|
|`DESC` |reserved |reserved
|
|
|
|
|`DESCRIBE` |reserved |reserved
|
|
|
|
|`DISTINCT` |reserved |reserved
|
2019-02-15 08:24:03 -05:00
|
|
|
|`ESCAPE` |reserved |reserved
|
2017-12-13 10:19:31 -05:00
|
|
|
|`EXISTS` |reserved |reserved
|
|
|
|
|`EXPLAIN` |reserved |reserved
|
|
|
|
|`EXTRACT` |reserved |reserved
|
|
|
|
|`FALSE` |reserved |reserved
|
2019-02-15 08:24:03 -05:00
|
|
|
|`FIRST` |reserved |reserved
|
2017-12-13 10:19:31 -05:00
|
|
|
|`FROM` |reserved |reserved
|
|
|
|
|`FULL` |reserved |reserved
|
|
|
|
|`GROUP` |reserved |reserved
|
|
|
|
|`HAVING` |reserved |reserved
|
2019-02-15 08:24:03 -05:00
|
|
|
|`HOUR` |reserved |reserved
|
|
|
|
|`HOURS` | |
|
2017-12-13 10:19:31 -05:00
|
|
|
|`IN` |reserved |reserved
|
|
|
|
|`INNER` |reserved |reserved
|
2019-02-15 08:24:03 -05:00
|
|
|
|`INTERVAL` |reserved |reserved
|
2017-12-13 10:19:31 -05:00
|
|
|
|`IS` |reserved |reserved
|
|
|
|
|`JOIN` |reserved |reserved
|
|
|
|
|`LEFT` |reserved |reserved
|
|
|
|
|`LIKE` |reserved |reserved
|
|
|
|
|`LIMIT` |reserved |reserved
|
|
|
|
|`MATCH` |reserved |reserved
|
2019-02-15 08:24:03 -05:00
|
|
|
|`MINUTE` |reserved |reserved
|
|
|
|
|`MINUTES` | |
|
|
|
|
|`MONTH` |reserved |reserved
|
2017-12-13 10:19:31 -05:00
|
|
|
|`NATURAL` |reserved |reserved
|
|
|
|
|`NOT` |reserved |reserved
|
|
|
|
|`NULL` |reserved |reserved
|
2019-02-15 08:24:03 -05:00
|
|
|
|`NULLS` | |
|
2017-12-13 10:19:31 -05:00
|
|
|
|`ON` |reserved |reserved
|
|
|
|
|`OR` |reserved |reserved
|
|
|
|
|`ORDER` |reserved |reserved
|
|
|
|
|`OUTER` |reserved |reserved
|
|
|
|
|`RIGHT` |reserved |reserved
|
2019-02-15 08:24:03 -05:00
|
|
|
|`RLIKE` | |
|
|
|
|
|`QUERY` | |
|
|
|
|
|`SECOND` |reserved |reserved
|
|
|
|
|`SECONDS` | |
|
2017-12-13 10:19:31 -05:00
|
|
|
|`SELECT` |reserved |reserved
|
|
|
|
|`SESSION` | |reserved
|
|
|
|
|`TABLE` |reserved |reserved
|
2019-02-15 08:24:03 -05:00
|
|
|
|`TABLES` | |
|
2017-12-13 10:19:31 -05:00
|
|
|
|`THEN` |reserved |reserved
|
|
|
|
|`TO` |reserved |reserved
|
|
|
|
|`TRUE` |reserved |reserved
|
2019-02-15 08:24:03 -05:00
|
|
|
|`TYPE` | |
|
2017-12-13 10:19:31 -05:00
|
|
|
|`USING` |reserved |reserved
|
|
|
|
|`WHEN` |reserved |reserved
|
|
|
|
|`WHERE` |reserved |reserved
|
|
|
|
|`WITH` |reserved |reserved
|
2019-02-15 08:24:03 -05:00
|
|
|
|`YEAR` |reserved |reserved
|
|
|
|
|`YEARS` | |
|
2017-12-13 10:19:31 -05:00
|
|
|
|
2017-12-20 11:06:54 -05:00
|
|
|
|===
|