In the below given resultset where there are 2 unique users (id) and there could be more such users coming out of the query:
Here is the multi-join query:
select
id, name, col1Code, col2Code, col2Value
from
users_table UT
join
col1_table C1T on UT.id = C1T.user_ID_FK
join
col2_table C2T on UT.id = C2T.user_ID_FK
order by
UT.id
limit 10
Let's say there are 50 such users from this query. If I apply limit of 10 for pagination purposes, I won't be getting 10 Users, but will be only getting the first 10 rows which may have only 1 or 2 users data.
Q1: How do I put limit based upon a particular column?
Q2: Is using the SQL limit clause the correct approach for pagination, also for improving the response time for end-user? If not then what else can be used in this scenario?