There was an SQL error: Expression #1 of ORDER BY clause is not in SELECT list, references column 'cine107.j.id' which is not in SELECT list; this is incompatible with DISTINCT - select DISTINCT member_id FROM jobs j WHERE j.is_del = "N" and j.member_id not in (1, 28158, 652632) and j.city_id not in (1,2,45,59,350,29,288,178,147) ORDER BY j.id DESC limit 108, 12