Friday, 28 December 2012

Rownum in sql server 2008 || How to find the Middle rows in sql server table

SELECT * FROM
(
   SELECT ROW_NUMBER() OVER(ORDER BY   Your_ColumnName) NUM,
   * FROM    YourTable_Name
) A
WHERE NUM >1 AND NUM <5