Using the MIN function in the having clause

后端 未结 7 1081
感动是毒
感动是毒 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:47

    How about using ROWNUM?

    SELECT *
    FROM(SELECT first_name, salary
         FROM Employees
         ORDER BY salary
    ) WHERE ROWNUM = 1
    

提交回复
热议问题