January 23, 2009 at 6:16 am
I want to select range of records from a table, for example if iam having 100 records means i have to select 31-40 row from my table
January 23, 2009 at 6:45 am
Try below query....
USE AdventureWorks;
GO
WITH OrderedOrders AS
(
SELECT SalesOrderID, OrderDate,
ROW_NUMBER() OVER (ORDER BY OrderDate) AS 'RowNumber'
FROM Sales.SalesOrderHeader
)
SELECT *
FROM OrderedOrders
WHERE RowNumber BETWEEN 50 AND 60;
What is your purpose of selecting such records? Could you please elaborate your problem?
Regards,
Nitin
January 23, 2009 at 9:13 am
Can you define how you determine which rows are rows 31-40? This will vary based on your order by.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
January 23, 2009 at 9:01 pm
Actually in my SSRS report i have more than one 1 lac records, i have to export this to a excel file. my hardware configuration is very less becuase of this the server become very slow while exporting the information to excel file. for this i have to split this 1 lac records into small segments and then i have to export.
January 23, 2009 at 9:05 pm
i think this query is enough for me do solve this issue
Thank you
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply