I want to get the friends of my friends who are not my friends. I have a table like this: userFriends(idUser, idUserFriend)
I was thinking about something like this:
select distinct idUserFriend from userFriends where idUser in
(select idUserFriend from userFriends where idUser = 1)
and idUserFriend not in (select idUserFriend from userFriends where idUser = 1)
But I am not sure if its so slowly or if it can be faster in another way.
Any views on this?