elasticsearch/docs/reference/esql/processing-commands/rename.asciidoc
Nik Everett 1256a49c3a
ESQL: Move description of commands in docs (#110714)
This copies the first line of the description of each command to just
under the syntax so that it's "in order", before the `Parameters`
section. That way if you are reading from top to bottom you see:
```
syntax
short description
parameter names and descriptions
long description
examples
```

I've also removed the `Description` section entirely if the description
was just one sentence. So in some cases that just isn't `long
description`.
2024-07-11 08:31:35 -04:00

40 lines
714 B
Text

[discrete]
[[esql-rename]]
=== `RENAME`
The `RENAME` processing command renames one or more columns.
**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]
----