WITH ResultSet AS ( SELECT ROW_NUMBER() OVER ( ORDER BY ErroLog.Field1, ErroLog.Field2, )AS RowNumber, TableAliasName.Field1 AS LogID, TableAliasName.Field2 AS UPL, FROM TableName AS TableAliasName WHERE TableAliasName.Field2 LIKE '111%' ) SELECT * FROM ResultSet WHERE RowNumber BETWEEN BeginCounter AND EndCounter
NOTE> This will not work for a billion reocords or more than that but will work upto million quite easily. I don't know how to fetch when the result set contains more than million in MSSQL.
0 comments:
Post a Comment