Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 21 Apr 2009 @ 09:29:03 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: SELECT Subquery
 
From:   Fred Newbrough

Hi Shaun

I left the join to the Loan table out in the previous version. Here is the corrected one:

You can do what you want by using a subquery:

Try something like this. I left the loan table out but it can easily be joined back in

     Select Loan_Id,Amount

     FROM
     Tran t1,Loan l
     WHERE
     PostDate IN (SELECT MAX(Post_Date) FROM Tran t2 WHERE t1.LoanID=t2.LoanID and
     Tran_Type='D') AND t1.LoanID=l.LoanID ;

-Fred



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023