How can i use a select statement inside another select query statement?

50 views Asked by At

I want to get a combination of logical select query output inside or along with another select statement like below, how can i achieve this in Sybase.

select col1, col2
       SELECT SUM(Rate_Index_Value) AS as Original_Interest_Rate 
       FROM ( 
         select Rate_Index_Value 
         from LOAN 
         where Loan_ID = 17781 and Processing_End_Date > '9999' 
           and Business_End_Date > '9999'
         UNION ALL
         select (BrokerDealer_Split + LendingBank_Split) AS Rate_Index_Value 
         from LOAN_PARTY 
         where Loan_ID = 17781 and Processing_End_Date > '9999' 
           and Business_End_Date > '9999' 
       ) LOAN_AND_LOAN_PARITY,
       col3,
       col4
from   table a
where  cond1 = cond1

This question is follow up on this this question and also it has details query stuff. Please help here.

0

There are 0 answers