• 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
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Help required with DB pagination

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I am trying to implement pagination in my reports using SQl queries.
My query is as follows


This works perfectly fine until I want to sort on the cust_id column of my table.
I am assuming that the query will be



This returns results like



Now when I query for the next set of records with


I get



How do I ensure that I get all rows with Cust Ids 1 in the first query and then all
with Cust ids 4 in the next query ?

Any help in this regard will be appreciated.

Thanks !!
 
Amber Vaidya
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think I got it ..
Tried this out



and it seems to be working fine.

Please let me know incase anyone sees any problem with this approach.

Thanks !!
 
author & internet detective
Posts: 42102
933
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Amber,
That approach is the one recommended by Ask Tom of Oracle.
 
It's exactly the same and completely different as this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic