Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Select 1st or 3rd occurance?
I have a select statement that selects items that are duplicate records, and groups them in three's(3 occurances). I want to be able to select only the first, or last occurance in that grouping. Is there a way to do this, outside of cursoring thru? My select is as follows:
select docket_id,
legacy_docket_number
from docket where
legacy_docket_number in(
select legacy_docket_number
from docket
group by legacy_docket_number having count(legacy_docket_number ) >1) order by legacy_docket_number
70238 B-00741-2001 126455 B-00741-2001
etc. I would like to be able to grab the 70220 and 70238 (1st in the
series). I can use a cursor, but would prefer a select for reporting
uses etc. Thanks
Bob Maggio
Received on Thu Jul 19 2001 - 10:06:38 CDT