Hello I'm trying to use an already calculated value in a select to calculate another value, for example:
SELECT 1+1 AS two, ***two* + 2** AS four FROM table
is this possible in BigQuery? I'm sure it's on SAS with the keyword CALCULATED as follows:
SELECT 1+1 as two, ***CALCULATED two* + 2** AS four FROM table
Thank you,
Mikhail Berlyant :
Below is example of how I personally approach such scenario (quite frequently btw)\nSELECT two, two + 2 AS four \nFROM table, UNNEST([STRUCT(1+1 as two)]) \n",
2022-05-24T22:54:06