SELECTteams.*FROM teamsLEFT JOIN players ON (teams.id = players.team_id)WHEREplayers.team_id IS NULL
或使用AREL(感谢JasonKing的评论):
Team.includes(:players).where('players.team_id IS NULL')