happyIndian100
Programmer
How to return the Nth to Mth row of a particular query?
thanks in advance
thanks in advance
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Create Procedure GetData
@FirstRow Integer,
@LastRow Integer
AS
SET NOCOUNT ON
Declare @Temp Table(RowId Integer Identity(1,1), Field1 DataTypeForField1, etc....)
Insert Into @Temp (Field1, etc...)
Select Field1, etc...
From Table
Where Condition=true
Order By SomeField
Select Field1, etc...
From @Temp
Where RowId Between @FirstRow And @LastRow
Order By RowId