select count(id) from ep_worksheets as W left join ep_worksheet_objectives as O where W.subject = '1' AND W.year='872' AND W.keyStage='420' and O.objective in (3769) 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 = '1' AND W.year='872' AND W.keyStage='420' and O.objective in (' at line 1