How does any app that returns a list from a database return unique rows when you click page 2,3...etc of the results? Say I have an app that communicates with a node-js server which queries a mysql db. How can I ensure efficiency when querying the database for more 'pages(list of rows) of data? How can I avoid SELECT * . This isn't specifically a mysql question just an organizational one.
Asked
Active
Viewed 51 times
1
-
Look into the `LIMIT` sql keyword. – doublesharp Jan 28 '17 at 18:31
-
I know I can limit the results, but how can I ensure that I'm returning unique rows each time I query for a new page? – Nemo_Sol Jan 28 '17 at 18:33
-
You can't. What if there are new records between the first and second requests? – doublesharp Jan 28 '17 at 18:39
1 Answers
1
I bet you mean pagination.
It's like words on pages in a book.
Say you can place only 250
words on one "page".
The whole "book" contains 26788
words that is... ceiling of 26788/250 = 108
"pages".
If that is what you mean, there are already some good examples on StackOverflow.

Community
- 1
- 1

Grzegorz Górkiewicz
- 4,496
- 4
- 22
- 38