使用此 编辑
SELECt `friend_id` AS `possible_friend_id`FROM `friends`WHERe `player_id` IN ( --selecting those who are known SELECT `friend_id` --by freinds of #1 FROM `friends` WHERe `player_id` = 1) AND `friend_id` NOT IN ( --but not those who are known by #1 SELECt `friend_id` FROM `friends` WHERe `player_id` = 1)AND NOT `friend_id` = 1 --and are not #1 himself --if one is known by multiple people --he'll be multiple time in the listGROUP BY `possible_friend_id` --so we groupORDER BY COUNT(*) DESC --and order by amount of repeatings



