I'm trying to compute several values on the fly. How can I create a temporary variable to use in my query?
SELECT n1, (n1*1.2), (n1*1.2) + (n1*0.8) FROM TABLE
I would like to establish the computed value of (n1*1.2) as a variable so I can continue to use it through the rest of my query. ANy help is appreciated.
I'm trying to compute several values on the fly. How can I create a temporary variable to use in my query?
SELECT n1, (n1*1.2), (n1*1.2) + (n1*0.8) FROM TABLE
I would like to establish the computed value of (n1*1.2) as a variable so I can continue to use it through the rest of my query. ANy help is appreciated.
i think what you need is a table variable to store all these computed values and use it later as you need to do it for each row of your table.