Finding nth row in SQL Server. Here is the simple query using ROW_NUMBER() function. In below example I am finding the 2 row:
Enjoy!!!!!!
SELECT * FROM
(SELECT ROW_NUMBER()OVER (ORDER BY id) AS Row,idFROM Table) AS EMPWHERE Row = 2
Enjoy!!!!!!
SELECT * FROM
ReplyDelete(SELECT ROW_NUMBER()
OVER (ORDER BY eno) AS Row,
*
FROM emp10) AS EMP
WHERE Row = (select count(*) from emp)