rename.asciidoc 714 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. [discrete]
  2. [[esql-rename]]
  3. === `RENAME`
  4. The `RENAME` processing command renames one or more columns.
  5. **Syntax**
  6. [source,esql]
  7. ----
  8. RENAME old_name1 AS new_name1[, ..., old_nameN AS new_nameN]
  9. ----
  10. *Parameters*
  11. `old_nameX`::
  12. The name of a column you want to rename.
  13. `new_nameX`::
  14. The new name of the column.
  15. *Description*
  16. The `RENAME` processing command renames one or more columns. If a column with
  17. the new name already exists, it will be replaced by the new column.
  18. *Examples*
  19. [source,esql]
  20. ----
  21. include::{esql-specs}/docs.csv-spec[tag=rename]
  22. ----
  23. Multiple columns can be renamed with a single `RENAME` command:
  24. [source,esql]
  25. ----
  26. include::{esql-specs}/docs.csv-spec[tag=renameMultipleColumns]
  27. ----