UPDATE friends INNER JOIN users ON friends.friendid=users.userid

SET friends.friendname=users.username

05-27 07:16