cancel
Showing results for 
Search instead for 
Did you mean: 

BODS: How to return rows that have last transaction date?

0 Kudos
2,790

Requirement:

If an order has 2 or more transactions, then return only row with last transaction date.

This can be done by using SQL as below. Table st1, and st2 are same table.

But how to achieve this via BODS Data_Flow design?

SELECT *

FROM source_table st1

WHERE st1.order_type = 'PO' AND transaction_date = ( SELECT MAX(transaction_date) FROM source_table st2 WHERE st2.order_type = st1.order_type AND st2.order_no = st1.order_no);

View Entire Topic
rajan_burad
Active Participant
0 Kudos

Hi Rock,

Let us know if you achieved your solution 🙂

Thanks,

Rajan 🙂