Forum Stats

  • 3,814,933 Users
  • 2,258,933 Discussions
  • 7,892,890 Comments

Discussions

get subset of data from a view

3004
3004 Member Posts: 204,171 Green Ribbon
I need to get 100 rows each time from a view which has about 2000 rows, i.e. get row 101 to 200 at one time, then 201 to 300 next time, and so on, we had a SQL statements doing this, but when the number getting larger (smaller number worked)I got a ORA-00600 error, here is the SQL to get the rows between 501 to 600 and failed:

SELECT * FROM
(SELECT A.*, rownum as rn FROM
(SELECT * FROM ABC_vw ORDER BY COLUMN_B) A
WHERE rownum <= 600)
WHERE rn BETWEEN 501 AND 600;

Does anybody know how to correct this problem or rewrite the SQL?

any help will be greatly appreciated.


null
This discussion has been closed.