我有两个表team
和bobotteam
,然后我尝试了这个查询:
SELECT team.id , bobotteam.teamfight/MAX(bobotteam.teamfight)
FROM team
INNER JOIN bobotteam on team.id = bobotteam.id
为什么数据只显示1个数据,即使bobotteam
表中有两个数据。
IMAGE
答案 0 :(得分:4)
请试试这个:
SELECT team.id , bobotteam.teamfight/(select MAX(bobotteam.teamfight) from bobotteam)
FROM team
INNER JOIN bobotteam on team.id = bobotteam.id