Um dies zu erreichen, sollten Sie den LEFT OUTER JOIN verwenden Operation Verbinden derselben Tabelle .
SELECT a.*
FROM meta_data a
LEFT OUTER JOIN meta_data b ON a.post_id = b.post_id AND b.meta_value = 'def'
WHERE
a.meta_value = 'abc'
AND b.post_id IS null