Hi,
Please help me out .

I need to retrieve the records from 11th row onwards using select query. Please help me out . Its urgent. Thanks

Recommended Answers

All 4 Replies

This is what I would do. Imagine you have table "Employee" with this two fields FirstName, LastName then you can do this.

SELECT FirstName, LastName, RowNumber
FROM(
SELECT Emp.FirstName, Emp.LastName, (SELECT COUNT(*) FROM Employee AS Emp2 WHERE (Emp2.LastName < Emp.LastName)) AS RowNumber
FROM Employee AS Emp) AS derivedTable
WHERE RowNumber >= 11
ORDER BY RowNumber
select * from (select FirstName, LastName, ROW_NUMBER() over (order by LastName,FirstName) as 'Row' ) a 
where Row >=11

Pretty much the same thing as jbisono's query.

The problem with your statement adam is that ROW_NUMBER() is not supported by SQL 2000, but besides that I like your statement better :-) ....

Missed that requirement, you are right.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.