Consider the following query
SELECT x + 2 AS d, x + 2 AS e FROM y;
Can I assign same value to d and e without repeating x + 2
. Assume x + 2
is some complex operation.
I can achieve this using CTE but cannot use it.
I’m using postgres.
Consider the following query
SELECT x + 2 AS d, x + 2 AS e FROM y;
Can I assign same value to d and e without repeating x + 2
. Assume x + 2
is some complex operation.
I can achieve this using CTE but cannot use it.
I’m using postgres.