BATCH-2040: Fix for erroneous SQL-Query in PagingQueryProvider

- added method for replacing qualifiers with subquery-qualifiers in
select clause
- refactored buildsort method