improves portability of SQL as proposed in david-binda/no-offset-pagination-for-wordpress#1