表'teams_members'
表'users_playeraccounts'
表'用户'
我的目标:使用召唤者名称和rank_solo获取当前团队成员,其中rank_solo是所有游戏中最高的
因此'users_playeraccounts'中的多个条目可以属于单个用户。
Select user_id,summoner_name,rank_solo
from teams_members t
join users_playeraccounts p on t.user_id = p.user_id
join users u on u.id = p.user_id
where team_id = 103
添加了一些内容我不知道
答案 0 :(得分:0)
试试这个
select a.username, u.rank_solo, u.summoner_name
from teams_members as t
inner join users_playeraccounts as u on t.user_id = u.user_id
inner join users as a on a.id in (select u.user_id from users_playeraccounts
group by u.summoner_name,
having max(u.rank_solo) );