An Error Was Encountered

Error Number: 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 '= post2cat.post_id WHERE post2cat.category_id = '4685' AND isPrivate= 0 AND post' at line 3

SELECT COUNT(posts.id) AS numPosts FROM posts JOIN post2cat ON .id = post2cat.post_id WHERE post2cat.category_id = '4685' AND isPrivate= 0 AND posts.user_id= '16' AND posts.post_status in ( 'publish','editorial','selected','awaitingmoderation')