Limit Rows in sql query output

  • From: Bala Krishna <krishna000@xxxxxxxxx>
  • To: "oracle-l@xxxxxxxxxxxxx" <oracle-l@xxxxxxxxxxxxx>
  • Date: Wed, 18 Jun 2014 15:01:46 +0530

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

Other related posts: