Answer the question
In order to leave comments, you need to log in
How to make pagination with join?
There is an entity with several associations, I need to display several, for example, 20 main entities and all their associations. If you do LIMIT OFFSET, then all of them are displayed in the database in a row and, accordingly, everything is cut off except for the first 20 lines, among which there can be records related to only one, first, main entity.
Let's say the main entity is User and Orders association.
It will be like this:
1) Пользователь1, Заказ1
2) Пользователь1, Заказ2
3) Пользователь2, Заказ5
4) Пользователь2, Заказ6
5) Пользователь2, Заказ11
6) Пользователь3, Зазаз29
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question