Display a range of rows from a table using oracle SQL -


i need display rows 256 700 table 'customers'. customers table can have rows in millions. customers table has primary key defined on 'cust_id'

probably fastest way this:

select c.* (select rownum seqnum, c.*       customers c       rownum <= 700      ) c seqnum >= 256; 

the caveat order of rows not defined in select query. things in right order, should use:

select c.* (select rownum seqnum, c.*       (select c.*             customers c             order cust_id            ) c       rownum <= 700      ) c seqnum >= 256; 

Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -