elasticsearch/docs/reference/esql/processing-commands/rename.asciidoc
Abdon Pijpelink 76ab37b35d
[DOCS] Uniform formatting for ES|QL commands (#101728)
* Source commands

* Missing word

* Processing commands

* Apply suggestions from code review

Co-authored-by: Alexander Spies <alexander.spies@elastic.co>

* Review feedback

* Add sort detail for mv

* More review feedback

---------

Co-authored-by: Alexander Spies <alexander.spies@elastic.co>
2023-11-06 08:42:13 +01:00

38 lines
652 B
Text

[discrete]
[[esql-rename]]
=== `RENAME`
**Syntax**
[source,esql]
----
RENAME old_name1 AS new_name1[, ..., old_nameN AS new_nameN]
----
*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]
----
Multiple columns can be renamed with a single `RENAME` command:
[source,esql]
----
include::{esql-specs}/docs.csv-spec[tag=renameMultipleColumns]
----