What I'm really trying to do is identify all WordPress post IDs (from wp_posts) where a Yoast SEO focus keyword record does not exist in wp_postmeta. This is a simplified version of the problem:
Want to return T1.id values 2,6 -- ie: only the values of T1.id that are equal to T2.fid, where T1.a = "2" and where T2.b does not equal "3".
ATTEMPT:
SELECT DISTINCT id FROM `T1` INNER JOIN `T2` ON `id` = `fid`
WHERE `a` = "2" AND NOT `b` = "3" ORDER BY ID ASC
This doesn't work. The same values are returned whether the "AND NOT 'b' = "3" is included or not. I am trying to get the 'b' = "3" condition to eliminate the id from the returned set.
Any help?
Thx!