我有一个wp_posts和wp_icl_translations表,它们在wp_posts.ID和wp_icl_translations.trid上相互关联。我想排除所有已经有翻译的帖子。以下查询正在检索我实际想要排除的所有行。
SELECT p.ID,
p.post_title
FROM wp_posts AS p
JOIN wp_icl_translations AS t
ON p.ID= t.trid
WHERE p.post_type = '{$type}' AND
p.post_status = 'publish' AND
t.language_code='en' AND
t.element_type='post_post'
ORDER BY post_title;