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