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

Why use triggers?

574


How to create view in stored procedure sql server?

507


Tell me what is the difference between locking and multi-versioning?

579


How do I install only the client tools of sql server 2000?

555


How to find the service pack installed? : sql server database administration

554






What are synonyms?

529


What is dimension table? : sql server analysis services, ssas

559


How to view existing indexes on an given table using sp_help?

594


Stored Procedure returns data from multiple tables. How to access it in your ASP.Net code?

553


How column data types are determined in a view?

534


What are triggers in ms sql server?

603


what is a transaction and what are acid properties? : Sql server database administration

526


Tell me what is difference between view and materialized view?

522


Explain microsoft sql server functions?

542


How to rename an existing table with the "sp_rename" stored procedure in ms sql server?

538