Skip to main content
Skip to main content

Replace modifier

Allows you to specify one or more expression aliases.

Each alias must match a column name from the SELECT * statement. In the output column list, the column that matches the alias is replaced by the expression in that REPLACE.

This modifier does not change the names or order of columns. However, it can change the value and the value type.

Syntax:

SELECT <expr> REPLACE( <expr> AS col_name) from [db.]table_name

Example:

SELECT * REPLACE(i + 1 AS i) from columns_transformers;
┌───i─┬──j─┬───k─┐
│ 101 │ 10 │ 324 │
│ 121 │  8 │  23 │
└─────┴────┴─────┘