select count(id) from ep_worksheets as W left join ep_worksheet_objectives as O where W.subject = '2' AND W.year='1292' AND W.keyStage='1288' and O.objective in (3845) and status='1' and organization_id IN (1)
SQLSTATE[42000]: Syntax error or access violation: 1064 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 'where W.subject = '2' AND W.year='1292' AND W.keyStage='1288' and O.objective in' at line 1