Error!

MySQL Error: 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 ' ) group by contents.id ORDER BY publish_date desc ) as t' at line 1
SQL Statement: select count(*) as total_records from (SELECT 1 FROM contents JOIN content_taxonomy on contents.id = content_taxonomy.content_id WHERE contents.published=1 and publish_date <= '2017-10-23 23:00:00' and contents.magazine_id = '13' and contents.magazine_id = 13 and ( contents.id != '101039') and contents.content_type_id = 2486 and content_taxonomy.taxonomy_id in ( , ) group by contents.id ORDER BY publish_date desc ) as t