mysql - MySQL 查询具有多个玩家 ID 的俱乐部名称
问题描述
我想选择具有多个 player_id 的 club_name。就像 yeshwant 有两个 club_ids 1,2 我只需要选择 yeshwant。我尝试使用此查询,但无法做到
select club_name,count(club_name) as t from club where count(club_name) >1 group by club_name;
解决方案
要查找拥有多个玩家的 club_names,您只需要一个简单的聚合:
select club_name
from club
group by club_name
having count(*)>1;
推荐阅读
- go - 将超过 7 天的数据插入分区 BigQuery 表
- sql - 如何在 SQL Replace 函数中传递大的 string_replacement
- java - 如何将带有其他对象数组的对象从一个片段传递到另一个片段?
- javascript - 使用Javascript将具有相同日期的数组中的对象组合成新的对象数组
- javascript - 从比较 getComputedStyle().width 值的函数返回意外的真值
- visual-c++ - 使用已知数据从 exe 读取
- c# - 有什么方法可以识别手动添加的引用与 Nuget 包添加的引用?
- python - 从 Pandas 中的 csv 文件创建数据框:列问题
- c++ - 测试 Cmake 运行完成但出现错误 (CLION)
- sparql - 使用 SPARQL 匹配属性集