SunQuest
           Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old January 19th, 2005, 12:52 AM
DBStudent DBStudent is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 54 DBStudent User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 1 m 34 sec
Reputation Power: 5
Paging in oracle

hi,

how to select specify record range from oracle? For example, a table called, "Student" has 20 records,
but i just want to extract the record from 11 to 15, how to do this? how to write the sql statement?


Thanks,

Reply With Quote
  #2  
Old January 19th, 2005, 03:33 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,711 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 6 Days 4 h 53 m 59 sec
Reputation Power: 259
Two ways:
Code:
select rownum, e.empno from scott.emp e group by e.empno, rownum having rownum between(1) and (3) order by rownum
or
Code:
select * from (select rownum, e.empno from scott.emp e) where rownum between(1) and (3) order by rownum

Reply With Quote
  #3  
Old January 20th, 2005, 07:38 PM
DBStudent DBStudent is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 54 DBStudent User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 1 m 34 sec
Reputation Power: 5
Quote:
Originally Posted by pabloj
Two ways:
Code:
select rownum, e.empno from scott.emp e group by e.empno, rownum having rownum between(1) and (3) order by rownum
or
Code:
select * from (select rownum, e.empno from scott.emp e) where rownum between(1) and (3) order by rownum



Thanks for ur solution, it works for me!

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > Paging in oracle


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway