我有两个表team
和bobotteam
,然后我尝试了这个查询:
SELECT team.id , bobotteam.teamfight/MAX(bobotteam.teamfight)
FROM team
INNER JOIN bobotteam on team.id = bobotteam.id
尽管我在bobotteam表中有两个数据,为什么数据仅显示1个?
我有两个表team
和bobotteam
,然后我尝试了这个查询:
SELECT team.id , bobotteam.teamfight/MAX(bobotteam.teamfight)
FROM team
INNER JOIN bobotteam on team.id = bobotteam.id
SELECT team.id , bobotteam.teamfight/(select MAX(bobotteam.teamfight) from bobotteam)
FROM team
INNER JOIN bobotteam on team.id = bobotteam.id
MAX(bobotteam.teamfight)
这里的 max()
是一个组函数,需要使用单独的子查询来执行。 - bharat