I have some issue with mysql pager.
- Count all rows is 164.
- pro_type - can be in 3 different integer values;
- pro - integer value;
- cr_date - some date.
Here is my queries:
SELECT id FROM table WHERE f1='1' AND f2='0' AND uid=43 ORDER BY pro_type DESC, pro DESC, cr_date DESC LIMIT 100;
SELECT id FROM table WHERE f1='1' AND f2='0' AND uid=43 ORDER BY pro_type DESC, pro DESC, cr_date DESC LIMIT 100 OFFSET 100;
- Second query result has duplicate rows from first query result.
- Both results do not contain one or few rows.
- The number of rows of the first query 100 and second is 64, so result count is ok.
- Query with limit 200 return all valid rows(164 not duplicated).
Maybe someone knows, what is the problem with ORDER BY & LIMIT OFFSET in that case?
Thank you.
SELECT DISTINCT id