При двама потребители @friend1 и @friend2 намерете всички потребители, които са им общи приятели:
SELECT user.uid
FROM user
WHERE EXISTS(
SELECT TOP 1 1
FROM Friends
WHERE Friends.fuid = @friend1 AND Friends.fapproved = 1
AND Friends.fuid2 = User.uid
)
AND EXISTS(
SELECT TOP 1 1
FROM Friends
WHERE Friends.fuid = @friend2 AND Friends.fapproved = 1
AND Friends.fuid2 = User.uid
)