How to return the second 5 rows in ms sql server?



How to return the second 5 rows in ms sql server?..

Answer / Navjot Singh

You can use a combination of `ROW_NUMBER()` and `OFFSET` to get the second 5 rows. Here is an example:n`SELECT * FROM ( SELECT *, ROW_NUMBER() OVER(ORDER BY column_name) AS row_number FROM table_name ) x WHERE row_number BETWEEN 6 AND 10`

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

wat will be the sql query to extract only last 3 records from table supose table hving thousands for records

19 Answers  


How many types of TRIGGERS are there in MS SQL Server?

8 Answers   CarrizalSoft Technologies, TCS, United Healthcare,


What is tabulation?

1 Answers  


How to delete duplicate rows from table except one?

1 Answers  


What are the differences in Clustering in SQL Server 2005 and 2008 or 2008 R2?

1 Answers  


What is the use of SCOPE_IDENTITY() function?

2 Answers  


Can you tell me the difference between DELETE & TRUNCATE commands?

15 Answers  


Why functions are used in sql server?

1 Answers  


How to invoke a trigger on demand?

1 Answers  


How to drop an existing schema in ms sql server?

1 Answers  


Explain what are the database objects? : SQL Server Architecture

1 Answers  


explain different types of jions with examples briefly?

1 Answers   Zensar,


Categories