Efficient or clever way to determine if there is a next page while paginating

I am getting 50 rows for each page from the database.

when the returned rows are less than 50 it is clear that there is no next page. but when the results are 50 rows, how can I determine if there is a next page efficiently.

As a last result I probably would do a "select count(*)" on the initial call but i am wondering if there is another way to save me this call to the database

Jon Skeet
people
quotationmark

The simplest option is simply to ask for 51 rows... if you only get 50 back, then it's clearly the last page. Even if 51 rows are returned, you only display 50 rows, but you know if there are any more available.

people

See more on this question at Stackoverflow