The pagination additional condition is added at the end of the query before the ORDER BY clause. If there is a GROUP BY this is what happens:`
SELECT * FROM XXX WHERE YYY GROUP BY ZZZ AND PAGINATION_CONDITION
I'm already working on fixing it myself. I think I've got it right but I'm still not getting the same results that I have with SQL Server 2005 so I'll check what's going on before the pull request.
Fix #367 pagination not working with group on SQLSERVER 2000.
The pagination condition was added before the ORDER condition.
If there is a GROUP BY clause, the pagination was in the GROUP BY
instead of the WHERE clause. New approach is extraction each clause and
build a new proper query.