SELECT wp_posts.*
FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id)
WHERE 1=1 AND (
wp_term_relationships.term_taxonomy_id IN (8)
) AND ((wp_posts.post_type = 'page' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'acf-disabled')))
GROUP BY wp_posts.ID
ORDER BY wp_posts.post_date ASC