WordPress database 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 'FROM wp_posts INNER JOIN wp_term_relationships ON wp_term_relationships.object' at line 2]
SELECT count(wp_posts.id) as campaigncount, FROM wp_posts INNER JOIN wp_term_relationships ON wp_term_relationships.object_id = wp_posts.id INNER JOIN wp_term_taxonomy ON wp_term_taxonomy.term_taxonomy_id = wp_term_relationships.term_taxonomy_id INNER JOIN wp_terms ON wp_terms.term_id = wp_term_taxonomy.term_id INNER JOIN wp_postmeta pm01 ON wp_posts.id = pm01.post_id INNER JOIN wp_postmeta pm02 ON wp_posts.id = pm02.post_id INNER JOIN wp_postmeta pm03 ON wp_posts.id = pm03.post_id INNER JOIN wp_postmeta pm04 ON wp_posts.id = pm04.post_id INNER JOIN wp_postmeta pm05 ON wp_posts.id = pm05.post_id WHERE wp_term_taxonomy.taxonomy = 'category' AND pm01.meta_key = 'textfield_campain_publishdate' AND pm02.meta_key = 'textfield_campain_term' AND pm03.meta_key = 'multi_checkbox_common_shop' AND pm04.meta_key = 'textfield_common_thumbnail' AND pm05.meta_key = 'textfield_common_detail' AND wp_posts.post_type = 'post' AND wp_posts.post_status = 'publish' AND wp_terms.slug = 'campain' GROUP BY wp_term_taxonomy.term_id, wp_posts.id