1
0

rename.asciidoc 652 B

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