Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to add results of 2 $amt Oracle subquery fields

Status
Not open for further replies.

BruceBussell

Programmer
Jul 14, 2003
49
US

How can you add the results of two $amount Oracle subquery fields together using their AS subquery column names

I get invalid column name errors when I try to reuse and add them together using the subquery results AS column names lower down in the main SQL script, although they display OK coming out of the subqueries.
 
What is your actual (wrong) SQL code ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
You can not use a column correlation name in other expressions, except in the order by clause.

The general technique is
Code:
select a + b
   from (select <expression> as a, <expression> as b, ...
            from ...) dt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top