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.

39 lines
652 B
Plaintext
Raw Normal View History

[discrete]
[[esql-rename]]
=== `RENAME`
**Syntax**
2023-06-26 22:31:53 +08:00
[source,esql]
----
RENAME old_name1 AS new_name1[, ..., old_nameN AS new_nameN]
2023-06-26 22:31:53 +08:00
----
*Parameters*
`old_nameX`::
The name of a column you want to rename.
`new_nameX`::
The new name of the column.
*Description*
The `RENAME` processing command renames one or more columns. If a column with
the new name already exists, it will be replaced by the new column.
*Examples*
[source,esql]
----
include::{esql-specs}/docs.csv-spec[tag=rename]
----
2023-06-26 22:31:53 +08:00
Multiple columns can be renamed with a single `RENAME` command:
[source,esql]
----
include::{esql-specs}/docs.csv-spec[tag=renameMultipleColumns]
----