string(2079) "
SELECT SQL_CALC_FOUND_ROWS gaepo_posts.ID
FROM gaepo_posts
WHERE 1=1 AND (
gaepo_posts.ID NOT IN (
SELECT object_id
FROM gaepo_term_relationships
WHERE term_taxonomy_id IN (1)
)
AND
gaepo_posts.ID NOT IN (
SELECT object_id
FROM gaepo_term_relationships
WHERE term_taxonomy_id IN (140,141,80,142,62)
)
AND
(
EXISTS (
SELECT 1
FROM gaepo_term_relationships
INNER JOIN gaepo_term_taxonomy
ON gaepo_term_taxonomy.term_taxonomy_id = gaepo_term_relationships.term_taxonomy_id
WHERE gaepo_term_taxonomy.taxonomy = 'category'
AND gaepo_term_relationships.object_id = gaepo_posts.ID
)
OR
EXISTS (
SELECT 1
FROM gaepo_term_relationships
INNER JOIN gaepo_term_taxonomy
ON gaepo_term_taxonomy.term_taxonomy_id = gaepo_term_relationships.term_taxonomy_id
WHERE gaepo_term_taxonomy.taxonomy = 'mchurch_archive_category'
AND gaepo_term_relationships.object_id = gaepo_posts.ID
)
OR
EXISTS (
SELECT 1
FROM gaepo_term_relationships
INNER JOIN gaepo_term_taxonomy
ON gaepo_term_taxonomy.term_taxonomy_id = gaepo_term_relationships.term_taxonomy_id
WHERE gaepo_term_taxonomy.taxonomy = 'mytory_photo_category'
AND gaepo_term_relationships.object_id = gaepo_posts.ID
)
OR
EXISTS (
SELECT 1
FROM gaepo_term_relationships
INNER JOIN gaepo_term_taxonomy
ON gaepo_term_taxonomy.term_taxonomy_id = gaepo_term_relationships.term_taxonomy_id
WHERE gaepo_term_taxonomy.taxonomy = 'mytory_video_category'
AND gaepo_term_relationships.object_id = gaepo_posts.ID
)
)
) AND ((gaepo_posts.post_type = 'post' AND (gaepo_posts.post_status = 'publish')) OR (gaepo_posts.post_type = 'mchurch_archive' AND (gaepo_posts.post_status = 'publish')) OR (gaepo_posts.post_type = 'mytory_photo' AND (gaepo_posts.post_status = 'publish')) OR (gaepo_posts.post_type = 'mytory_video' AND (gaepo_posts.post_status = 'publish')))
GROUP BY gaepo_posts.ID
ORDER BY gaepo_posts.post_date DESC
LIMIT 0, 6
"