how to query a table with hidden values

I have a table called USERS, some of its records are marked as  hiddenRcord, I want to load those records in a custom page in my asp.net webpage with paging enabled, each page contains 10 records. 

I use the statement "SELECT Top 10 tableID,userName FROM USERS WHERE (hiddenRecord=0 AND tableID>@tableID)"

the pagination has 5 links (First,2,3,4,Last), I can of course put the last tableID in link number 2, but I don't know how to do it for the links (3,4,Last).

Is there a way to solve this problem, please help me.


August 31st, 2015 7:11am

Nobody answered me, so I tried and discovered that I can solve the problem by using a view in sql server.
Free Windows Admin Tool Kit Click here and download it now
August 31st, 2015 10:01pm

  1. You can either use row_number() function. Refer this  or
  2. Offset and fetch

 

You can try them based on your SQL version. Hope this helps.

August 31st, 2015 10:28pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics