I need to implement the following query:
SELECT * FROM friend WHERE ( friend.id1, friend.id2 ) NOT IN (SELECT id1, id
You should probably use NOT EXISTS for multiple columns.
NOT EXISTS