Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I have implented such a work in my initial career days like 15 yrs back there i have implemented first, previous,next, last no goto page number. It works for multiple columns in the order by. The trick is to swith the order by in reverse and limit the results to page size, this way we get results in reverse orde but while returning just send them.in the reverse order....

The assumption is to include the primary key as mandatory order by at the end implicitly.

This makes a lot easy in other situations like if mulitple pages of records found with same value.. etc...



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: