elasticsearch/docs/reference/esql/processing-commands/rename.asciidoc
Bogdan Pintea fa8b34cb88 Change RENAME's syntax from using = to AS (ESQL-1462)
This changes the `RENAME` syntax from `RENAME new = old` to `RENAME old
AS new`.

Fixes ESQL-1447.
2023-07-25 12:26:35 +02:00

26 lines
473 B
Text

[[esql-rename]]
=== `RENAME`
Use `RENAME` to rename a column using the following syntax:
[source,esql]
----
RENAME <old-name> AS <new-name>
----
For example:
[source,esql]
----
include::{esql-specs}/docs.csv-spec[tag=rename]
----
If a column with the new name already exists, it will be replaced by the new
column.
Multiple columns can be renamed with a single `RENAME` command:
[source,esql]
----
include::{esql-specs}/docs.csv-spec[tag=renameMultipleColumns]
----