我想顯示薪水最高的玩家。爲什麼sql中的max函數返回多個值
select max(Salary) as highest_salary, p.[Last name]
from tbl_PlayersTable as p, tbl_team as t
where p.Team = t.TeamID
and TeamID = 1000
Group by p.[Last name]
輸出是:
highest_salary Last Name
8000 Bosh
7000 Wade
6000 James
我只是想顯示(8000波什,因爲他是薪水最高的球員)。
SQL服務器2005 – user1954418 2013-05-08 07:29:23
什麼是你的輸出? – 2013-05-08 07:35:55
你爲什麼按姓氏分組? – Gibron 2013-05-08 07:39:53