Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Mon, 21 Apr 2009 @ 00:37:35 GMT

  <Prev Next>  
Next> Last>>  

Subj:   SELECT Subquery
From:   Steckley, Shaun

I started writing a query today where I thought I would just use a subquery and finish it quickly. However, after researching a good part of today it seems like Teradata does not allow subqueries in the SELECT division. Is this correct?

If so, could someone please help me determine the best way to re-write the following query? I need to pull the most recent transaction of a specific type from the transaction table and return it with each for each loan record in the Loan table. I am trying to do it in a single query.

           SELECT TOP 1 Amount
              from Tran
              WHERE Tran.LoanID = Loan.LoanID
                AND Tran.Type =  D
              ORDER BY PostDate DESC
         ) Tran_Amount


Thank you all in advance for your assistance.


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