Questions tagged [pagination]

Pagination is the process of dividing information into discrete pages.

Pagination is the process of dividing information into discrete pages. Pagination is often used for the purpose of printing or searching information.

Pagination in Web content (HTML, ASP, PHP, and others)

On the Internet, pagination is used for such things as displaying a limited number of results on search engine results pages, or showing a limited number of posts when viewing a forum thread. Pagination is used in some form in almost every web application to divide returned data and display it on multiple pages. Pagination also includes the logic of preparing and displaying the links to the various pages.

Links

Wikipedia Pagination

17657 questions
1310
votes
15 answers

How do I limit the number of rows returned by an Oracle query after ordering?

Is there a way to make an Oracle query behave like it contains a MySQL limit clause? In MySQL, I can do this: select * from sometable order by name limit 20,10 to get the 21st to the 30th rows (skip the first 20, give the next 10). The rows are…
Mathieu Longtin
  • 15,922
  • 6
  • 30
  • 40
777
votes
32 answers

Check if a user has scrolled to the bottom (not just the window, but any element)

I'm making a pagination system (sort of like Facebook) where the content loads when the user scrolls to the bottom. I imagine the best way to do that is to find when the user is at the bottom of the page and run an Ajax query to load more posts. The…
Johnny
  • 9,725
  • 5
  • 29
  • 34
592
votes
19 answers

What is the best way to paginate results in SQL Server

What is the best way (performance wise) to paginate results in SQL Server 2000, 2005, 2008, 2012 if you also want to get the total number of results (before paginating)?
Panagiotis Korros
  • 10,840
  • 12
  • 41
  • 43
354
votes
12 answers

API pagination best practices

I'd love some some help handling a strange edge case with a paginated API I'm building. Like many APIs, this one paginates large results. If you query /foos, you'll get 100 results (i.e. foo #1-100), and a link to /foos?page=2 which should return…
2arrs2ells
  • 3,637
  • 3
  • 15
  • 12
343
votes
13 answers

Pagination in a REST web application

This is a more generic reformulation of this question (with the elimination of the Rails specific parts) I am not sure how to implement pagination on a resource in a RESTful web application. Assuming that I have a resource called products, which of…
andi
  • 14,322
  • 9
  • 47
  • 46
319
votes
36 answers

How to paginate with Mongoose in Node.js?

I am writing a webapp with Node.js and mongoose. How can I paginate the results I get from a .find() call? I would like a functionality comparable to "LIMIT 50,100" in SQL.
Thomas
  • 10,289
  • 13
  • 39
  • 55
285
votes
9 answers

MySQL Data - Best way to implement paging?

My iPhone application connects to my PHP web service to retrieve data from a MySQL database, a request can return up to 500 results. What is the best way to implement paging and retrieve 20 items at a time? Let's say I receive the first 20 entries…
aryaxt
  • 76,198
  • 92
  • 293
  • 442
259
votes
22 answers

How to do paging in AngularJS?

I have a dataset of about 1000 items in-memory and am attempting to create a pager for this dataset, but I'm not sure on how to do this. I'm using a custom filter function to filter the results, and that works fine, but somehow I need to get the…
Micael
  • 6,950
  • 6
  • 25
  • 28
232
votes
4 answers

Run a query with a LIMIT/OFFSET and also get the total number of rows

For pagination purposes, I need a run a query with the LIMIT and OFFSET clauses. But I also need a count of the number of rows that would be returned by that query without the LIMIT and OFFSET clauses. I want to run: SELECT * FROM table WHERE /*…
Tim
  • 4,999
  • 3
  • 24
  • 29
213
votes
18 answers

Equivalent of LIMIT and OFFSET for SQL Server?

In PostgreSQL there is the Limit and Offset keywords which will allow very easy pagination of result sets. What is the equivalent syntax for SQL Server?
Earlz
  • 62,085
  • 98
  • 303
  • 499
195
votes
6 answers

Implement paging (skip / take) functionality with this query

I have been trying to understand a little bit about how to implement custom paging in SQL, for instance reading articles like this one. I have the following query, which works perfectly. But I would like to implement paging with this one. SELECT TOP…
Lars Holdgaard
  • 9,496
  • 26
  • 102
  • 182
176
votes
16 answers

LIMIT 10..20 in SQL Server

I'm trying to do something like : SELECT * FROM table LIMIT 10,20 or SELECT * FROM table LIMIT 10 OFFSET 10 but using SQL Server The only solution I found looks like overkill: SELECT * FROM ( SELECT *, ROW_NUMBER() OVER (ORDER BY name) as row…
marcgg
  • 65,020
  • 52
  • 178
  • 231
158
votes
14 answers

Laravel Pagination links not including other GET parameters

I am using Eloquent together with Laravel 4's Pagination class. Problem: When there are some GET parameters in the URL, eg: http://site.example/users?gender=female&body=hot, the pagination links produced only contain the page parameter and nothing…
Nyxynyx
  • 61,411
  • 155
  • 482
  • 830
137
votes
12 answers

Paging in a Rest Collection

I'm interested in exposing a direct REST interface to collections of JSON documents (think CouchDB or Persevere). The problem I'm running into is how to handle the GET operation on the collection root if the collection is large. As an example…
Karl Guertin
  • 4,346
  • 2
  • 22
  • 19
133
votes
6 answers

Pagination on a list using ng-repeat

I'm trying to add pages to my list. I followed the AngularJS tutorial, the one about smartphones and I'm trying to display only certain number of objects. Here is my html file:
Tomarto
  • 2,755
  • 6
  • 27
  • 37
1
2 3
99 100