Though I don't understand the reason behind inserting the data into the same table ... Should it be an Update than the Insert...
However, here's how you could achieve...
Approach # 1
---------------------
INSERT FriendRequests (userid, friendid)
SELECT
UserIdValue=CASE WHEN UserId<>2 AND FriendId<>1 THEN 1 ELSE UserId,
FriendIdValue=CASE WHEN UserId<>2 AND FriendId<>1 THEN 2 ELSE FriendId
FROM FriendRequests
Approach # 2
---------------------
INSERT FriendRequests (userid, friendid)
SELECT 1,2 FROM friendrequests WHERE userid <> 2 AND friendid <> 1
UNION ALL
SELECT userid ,friendid FROM friendrequests WHERE userid = 2 AND friendid = 1
The above approaches are meant for inserting the data... and operations of both are pretty self explanatory.
Now, if your real quest was to Update -
UPDATE friendrequests
SET UserId=CASE WHEN UserId<>2 AND FriendId<>1 THEN 1 ELSE UserId,
FriendId=CASE WHEN UserId<>2 AND FriendId<>1 THEN 2 ELSE FriendId
Tell us if you have trouble understanding or implementing it.
--In 'thoughts'...
Lonely Rogue.
https://twitter.com/LonelyRogue