![]() |
|
Archives of the TeradataForumMessage Posted: Tue, 21 Apr 2009 @ 09:35:28 GMT
<-- Anonymously Posted: Monday, April 20, 2009 20:53 --> Making a few assumptions about your data model - but I'd try:
SELECT Loan.LoanID, Tran.Amount
FROM Loan INNER JOIN Tran
ON Loan.LoanID = Tran.LoanID
WHERE Tran.Type = 'D'
QUALIFY ROW_NUMBER() OVER (PARTITION BY Tran.LoanID ORDER BY PostDate
DESC) = 1;
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||