sql - Filter top by group -
we have following situation query in oracle.
we have orders , transactions, order being mapped multiple transactions.
order orderid|customer|..... transaction orderid|transactionid|transactiondate|.....
we need display latest transaction each order. how go in oracle 11g?
this 1 method
select t1.* transactions t1 inner join ( select orderid,max(transactiondate) transactiondate transactions group orderid ) t2 on o.orderid=t.orderid , t1.transactiondate =t2.transactiondate
Comments
Post a Comment