-
DuckDB allows direct usage of column aliases in the same statement (see this and this). So for example these are valid statements: SELECT 'foo' as a
WHERE a = 'foo' SELECT
i + 1 AS j,
j + 2 AS k
FROM range(0, 3) t(i) Transpiling statements like that, for example to postgres, with Now I imagine this isn't trivial to solve for arbitrary SQL, so is this something SQLGlot wants to take into account or does this fall under "However, SQLGlot does not aim to be a SQL validator, so it may fail to detect certain syntax errors"? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
you can use the optimizer qualify columns to remove the aliases usages |
Beta Was this translation helpful? Give feedback.
you can use the optimizer qualify columns to remove the aliases usages