You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'or INNER JOIN (SELECT id from or order by id limit 100 OFFSET 0) AS my_results U' at line 1