I have the table \'meta_data\' with the following fields:
I\'d like to loop throug
To achieve this you should use the LEFT OUTER JOIN operation joining the same table.
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