选择具有MySQL列的最大值的行

Dil*_*dra 1 mysql

我有一个表名"员工",我需要与薪酬最大值并在员工从"纽约",让行.

select * from employee where city = 'New York' and MAX(salary);
Run Code Online (Sandbox Code Playgroud)

似乎不起作用,请建议我一个方法

在此输入图像描述

Sas*_*ant 5

试试这个::

select 
* 
from employee 
where city = 'New York' 
order by Salary desc limit 1
Run Code Online (Sandbox Code Playgroud)