Using the MIN function in the having clause

后端 未结 7 1101
感动是毒
感动是毒 2021-01-18 07:06

I want to get the name of the employee who has the minimum salary. Is there a way to do this using only one query? I have given my query below, it doesn\'t work because the

7条回答
  •  感情败类
    2021-01-18 07:58

    If you need the employee with the lowest salary why don't you use Order By ..

    SELECT top 1 first_name,min(salary) as LowestSalary
    FROM Employees order by Salary asc
    

提交回复
热议问题