Suppose I have a query that starts something like this:
SELECT
(4.179 * (Avg_Flow_Rate * 0.453597) * (30 * 24) * (Avg_Out_Temp - Avg_Return_Temp)) / 3600 AS Usage_kWh,
(4.179 * (Avg_Flow_Rate * 0.453597) * (30 * 24) * (Avg_Out_Temp - Avg_Return_Temp)) / 3600 * 3412.14163 AS Usage_BTU,
...
Is there any way in the second formula to refer back to the field from the first one? Something like:
SELECT
(4.179 * (Avg_Flow_Rate * 0.453597) * (30 * 24) * (Avg_Out_Temp - Avg_Return_Temp)) / 3600 AS Usage_kWh,
Usage_kWh * 3412.14163 AS Usage_BTU,
...
I know I could set up a temporary table but how about within one query?
Thanks!