LET clause

LET clause

LET (alias = expression) [, (alias = expression)]*

LET stores the result of a sub-expression in order to use it in subsequent clauses.

Aliases in the LET clause create new names that can be referred to anywhere in the query.