Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: How To Pull Second Row from 100 ROWS
If swallowed seek medical advice
> -----Original Message-----
> From: Muqthar Ahmed [mailto:Muqthar.Ahmed_at_decoratetoday.com]
> Sent: Wednesday, 22 October 2003 06:44
> To: Multiple recipients of list ORACLE-L
> Subject: How To Pull Second Row from 100 ROWS
>
>
> Hi,
>
> Is there a way to pull ONLY 2nd row from the selected rows.
>
> Thanks
> Muqthar Ahmed
> DBA
Others have shown the proprietary Oracle way. Assuming your instance has the necessary plumbing, you can use the OLAP approach ... which also happens to transport to other RDBMS.
SELECT a.blah, a.blahblah ...
FROM
( SELECT
ROW_NUMBER() OVER (blah) AS row_number, blah, blahblah
FROM <your table>
[where ...]
) a
WHERE a.row_number =2;
Enjoy!
Ciao
Fuzzy
:-)
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Grant Allen INET: Grant.Allen_at_towersoft.com.au Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Tue Oct 21 2003 - 19:44:25 CDT