## RENAME

The `RENAME` command in ES|QL is used to rename one or more columns in a table. If a column with the new name already exists, it will be replaced by the new column. This command can be useful in scenarios where you want to make column names more descriptive or to conform to a certain naming convention.

However, it's important to note that if a column with the new name already exists, it will be replaced by the new column. Therefore, caution should be exercised to avoid unintentionally overwriting existing columns.

### Syntax

```
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.

### Examples

Here are some examples of how the `RENAME` command can be used in ES|QL queries:

1. Renaming a single column:

    ```esql
FROM employees
| KEEP first_name, last_name, still_hired
| RENAME still_hired AS employed
```

2. Renaming multiple columns with a single `RENAME` command:

    ```esql
FROM employees
| KEEP first_name, last_name
| RENAME first_name AS fn, last_name AS ln
```

3. Renaming a column and using the new name in a subsequent command:

    ```esql
FROM employees
| RENAME salary AS annual_income
| WHERE annual_income > 50000
```

In the third example, after renaming the `salary` column to `annual_income`, we can use the new column name in subsequent commands in the query.