• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Help required with DB pagination

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • 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
  • 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: 40035
809
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Amber,
That approach is the one recommended by Ask Tom of Oracle.
 
    Bookmark Topic Watch Topic
  • New Topic