• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

can i display only first few records from oracle sql

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
helo to everyone on javaranch,
i am using oracle as a backend on j2ee, they r about 1000 records my sql query retreives. Since storing 1000 records at the server side will increase the burden on server i want to display only firt 50 and then next 50 upon the client request.
Is there any provision in oracle sql using which i can retrieve only first few records then next few records.
thanx in advance
 
Ranch Hand
Posts: 336
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use ROWNUM for that..
select ...
from ...
where ...
and rownum < 50
 
srinivas sv
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanx for reply,
They r many columns which have to be retreived will the use of rownum will effect the performance.
 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,
I think there is no performance issue as rownum is generated for each record when you run SQL QUery therefore when 1000 records are returned from server then each one is given a unique id even though you do not use it only performance concern is that last Where clause which i dont think will take much of the query excecution time.
Any suggestions
 
reply
    Bookmark Topic Watch Topic
  • New Topic