2013-10-17 93 views

回答

5

試試這個::

select 
* 
from employee 
where city = 'New York' 
order by Salary desc limit 1 
+0

非常感謝!這工作! –

2

這是簡單的方法。你也可以使用組通過再分查詢

select * from employee where city = 'New York' order by Salary desc limit 1 
0

這樣,你會得到所有從紐約有薪水最高的員工。 I.E.如果你有另一位salary = 2000的員工,你也會收到。

SELECT * FROM employee WHERE city = 'New York' AND salary = MAX(salary);