if i have 1000 records and i want to access 20 ata time
from SQL server, what will be the query?

Answer Posted / rasbeer

Declare @PageIndex int
set @PageIndex=2

select top 20 * from
(select top 20 * from
(select top (@PageIndex*20) * from chat_contents order by
id ) as a1
order by id desc)as b1 order by id

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between CC and BCC?

618


Why we use content place holder in asp.net?

502


Define a static class?

533


What are the advantages of passport authentication?

515


Can you explain page lifecycle in net?

510






What are different methods of session maintenance in asp.net?

567


What r the asp.net list controls and diff. Between them?

507


In which event of the page viewstate is available?

468


What is the use of web.config and machine.config files?

627


How to automatically get the latest version of all the asp.net solution items from source safe when opening the solution?

525


What is the difference between executescalar and executenonquery?

514


What is redirecting behavior?

523


What are the steps involved to fill a dataset?

556


What is the difference between page.registerclientscriptblock and page.registerstartupscript?

484


Can you explain composite pattern?

594