How to retrieve range of 10th rows to 20 th rows from total
rows from a database table.? (Not from Dataset)

Answer Posted / upendra

USE CTE

http://www.4guysfromrolla.com/webtech/071906-1.shtml


WITH CTE_Table AS ( SELECT
Row_number() OVER (
ORDER BY
sort_Column ) AS RowNum
, premiumamount
FROM
shplaninfo )

SELECT
*
FROM
CTE_Table
WHERE
RowNum BETWEEN ( 10 ) AND ( 19 )

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to filter out duplications in the returning rows in ms sql server?

807


How to reaname table name without using sp_Rename in sql server..?

720


How to query multiple tables jointly?

704


What are the restrictions while creating batches in sql server?

751


What is postgresql server?

687






What are the rules to use the rowguidcol property to define a globally unique identifier column?

745


Can we call future method from queueable?

747


What is difference between getdate and sysdatetime in sql server 2008?

772


Explain an incremental backup?

748


Explain transaction server distributed transaction?

672


Do you know hot add cpu in sql server 2008?

725


Is it possible in sql table to have more than one foreign key?

776


What are the differences between clustered and non-clustered index?

709


What are the components of dbms?

710


What is the dbcc command and why is it used?

752