我想编写一个查询,将在表中获取玩家的数量在一个运动队对每一个国家:帮助中写一个SQL查询
我有一个表具有以下字段
country | sports_team | player_name
我要显示与此类似
country | sports_team | number_of_players
即reulst我想遍历所有国家,以及在SPORTS_TEAM每一个变化,我想记录numm队中的球员。
样品表:
country | sports_team | player_name
c1 | teamA | name1
c1 | teamA | name2
c1 | teamB | name3
c2 | teamC | name4
c2 | teamC | name5
样品结果
country | sports_team | number_of_players
c1 | teamA | 2
c1 | teamB | 1
c2 | teamC | 2
我是新来编写SQL查询,我不知道如何PROCEDE,任何帮助将不胜感激!
尝试在SELECT语句读取只是一个小数目。这应该在第2页左右。 – Randy