rename.asciidoc 484 B

123456789101112131415161718192021222324252627
  1. [discrete]
  2. [[esql-rename]]
  3. === `RENAME`
  4. Use `RENAME` to rename a column using the following syntax:
  5. [source,esql]
  6. ----
  7. RENAME <old-name> AS <new-name>
  8. ----
  9. For example:
  10. [source,esql]
  11. ----
  12. include::{esql-specs}/docs.csv-spec[tag=rename]
  13. ----
  14. If a column with the new name already exists, it will be replaced by the new
  15. column.
  16. Multiple columns can be renamed with a single `RENAME` command:
  17. [source,esql]
  18. ----
  19. include::{esql-specs}/docs.csv-spec[tag=renameMultipleColumns]
  20. ----