-2

I wonder, is there any option like "Skip"(from LINQ) in SQL to select particular rows in a table.

I mean, in a table named "abcd". In that table 300 rows are there. but from that 300 rows i want to select rows from 233 to 300 or 233 to 258.

How to do this?? Please anyone help.

1
  • When you use the Skip operator in LINQ-to-SQL, it actually generates SQL code to execute it server-side. You can verify this yourself with something like Console.WriteLine(myContext.Entities.Skip(50).Take(10)), and you'll see the auto-generated SQL code for skipping rows. Commented Jun 10, 2015 at 18:58

1 Answer 1

0

You can use a cte or derived table for this:

With cte as (
    Select col1, col2, row_number() over(order by sortColumn) as rn
    From table
)
Select * 
from cte 
Where rn >= 233
And rn <= 258
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.