adspace


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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

How raid can influence database performance?

1127


How can we solve concurrency problems?

1130


Where can you add custom error messages to sql server?

1220


Can we shrink data file in sql server?

1135


Can you index views?

958


What is an indexed view?

1030


What is acid mean in sql server?

1257


Can sql servers link to other servers like oracle?

928


What kind of problems occurs if we do not implement proper locking strategy?

1508


You have a stored procedure, which execute a lengthy batch job. This stored procedure is called from a trigger you do not want to slow the data entry process you do not want trigger to wait for this batch job to finish before it completes itself what you can do to speed up the process?

1223


Why we use the openxml clause?

1088


How to remove duplicate rows from table except one?

1096


what is the difference between openrowset and openquery?

1208


What is self contained sub query?

1148


What is a view in sql?

1048