RE: Limit Rows in sql query output

From: Maris Elsins <elmaris_at_gmail.com>
Date: Wed, 18 Jun 2014 12:56:00 +0300
Message-ID: <CABQhObsDdGkQeLU8boKNir9tAU8Da49gKg6TenASU+kf_vTknw_at_mail.gmail.com>



... or use the Row Limiting Clause if you're on 12c. On 18 Jun 2014 12:40, "Mckay-dirden, Michael (Student)" < mckaydim_at_aston.ac.uk> wrote:

> Move the rownum to after it's been sorted:
>
>
> SELECT * FROM (SELECt m.* FROm EM_INFO m ORDER BY DBNAME ASC) WHERE
> rownum >=1 AND rownum <=50
>
>
> Regards,
> Mike
> ------------------------------
> *From:* oracle-l-bounce_at_freelists.org <oracle-l-bounce_at_freelists.org> on
> behalf of Bala Krishna <krishna000_at_gmail.com>
> *Sent:* 18 June 2014 10:31
> *To:* oracle-l_at_freelists.org
> *Subject:* Limit Rows in sql query output
>
> Hi All,
>
> We are intrested in fetching output on rows wise for ex.
>
> in first iteration 1 .. 50
> second iteration 51 .. 100
> Third iteration 101 .. 150 so on .
>
> SELECT * FROM (SELECt m.*,rownum r FROm EM_INFO m ORDER BY DBNAME ASC)
> WHERE r >=1 AND r <=50
>
> or
>
> SELECT * FROM (SELECt m.*,rownum r FROm EM_INFO m ) WHERE r >=1 AND r <=50
> and ORDER BY DBNAME ASC
>
> I've tried with both the above queries but its not displaying in the
> sorted order Can somebody help me pls .
>
> Regards
> Bala
>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Wed Jun 18 2014 - 11:56:00 CEST

Original text of this message