Hi there,

I have a database table that has entries of users and their friends. so this tblFriendUser has a column called UserName and another column called FriendUserName.
I am trying to get a list of friends for that particular user. Note that if User1 initiated the friend request, he will be listed as UserName and his friend as FriendUserName, but if his friend initiated the friend request, it will be vice versa: him being the FriendUserName and his friend the UserName. So I want the following 2 queries added to one query and returning 2 columns: UserFriendID & UserName, is that possible? Is my design bad? Any suggestions would help! Thanks a lot!


SELECT UserFriendID, UserName
FROM tblUserFriends
WHERE (UserName = @UserName);

SELECT UserFriendID, FriendUserName AS UserName
FROM tblUserFriends
WHERE (FriendUserName= @UserName);