Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to get first record of each item only ?

Re: How to get first record of each item only ?

From: Carlos <miotromailcarlos_at_netscape.net>
Date: 22 Apr 2005 02:47:41 -0700
Message-ID: <1114163261.352390.327360@o13g2000cwo.googlegroups.com>


Sorry, I misunderstood the question.

It would be something like:

select itemid, qty from

                     (select itemid, qty, rank() over (partition by
itemid order by THE_ORDER_YOU_WANT)  v_rank )
          where v_rank = 1;

Cheers. Received on Fri Apr 22 2005 - 04:47:41 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US