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