आप इसे NOT EXISTS
. का उपयोग करके लिख सकते हैं :
SELECT
id, client_id, buyer_id
FROM relation AS r
WHERE NOT EXISTS
( SELECT 1
FROM <some_table>
WHERE (r.client_id = <some_id> OR r.buyer_id = <some_id>)
AND ...
) ;