How to use a calculated column in the same query
551174Jun 5 2009 — edited Jun 5 2009Hi All,
I need some help with using a calculated column in the same query.
For eq
I am joining a couple of tables and some of the select columns are calculated based on the columns of the tables and i want a new column in the same query to use this calculated feild in some other calcualtion.
something like this...
select (12+3) as Sum1, (12-3) as Sum2, (Sum1 + Sum2 ) as Sum3
from dual
or
select (12+3) as "Sum1", (12-3) as "Sum2", CASE WHEN ( "Sum1" / "Sum2" * 100 > 0 ) THEN 'Yes' ELSE 'No' END
from dual
Thanks