Click here to Skip to main content
15,905,420 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
There is a GRID on UI which displays page by page information as ">>" button is clicked. This button fetches data from database using the following query:
SQL
with y 
as 
(
    select 
      version, 
      Id ,
      row_number() over (order by Id,version) r 
    from 
      X
)
select 
  Id,
  version 
from 
   y 
where 
   r>20 and r<30


X is a contract table with ID of Contract and Version together as primary key. A lot of terms of the contract are there which will be the columns. The version is to maintain a trail of changes made to any contract.

If currently loaded rows in the grid is between row_number() 1 to 10 .. and before the user clicks the ">>" button if newer version comes in the database for Ids already displayed on UI, the row_number() count will not work .. also I need to display all records via paging in GRID
Posted
Updated 8-Oct-13 2:04am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900