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 ') and p.post_status not in ('trash') ' at line 5]
select post_id, cast(meta_value as UNSIGNED) as page from wp_postmeta pm left join wp_posts p on pm.post_id=p.id where pm.meta_key='Page' and pm.post_id in (select post_id from wp_postmeta where meta_key='Publication' and meta_value='Proletarian') and pm.post_id in (select post_id from wp_postmeta where meta_key='IssueNumber' and meta_value=) and p.post_status not in ('trash') order by page,pm.post_id asc