elasticsearch/docs/reference/esql/processing-commands/rename.asciidoc

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
484 B
Plaintext
Raw Normal View History

[discrete]
[[esql-rename]]
=== `RENAME`
2023-06-26 22:31:53 +08:00
Use `RENAME` to rename a column using the following syntax:
[source,esql]
----
RENAME <old-name> AS <new-name>
2023-06-26 22:31:53 +08:00
----
For example:
[source,esql]
----
include::{esql-specs}/docs.csv-spec[tag=rename]
----
2023-06-26 22:31:53 +08:00
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]
----