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

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -