Using the MIN function in the having clause

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

    SELECT first_name, salary  as "sal" 
    FROM   employees
    WHERE  salary =(SELECT MIN(salary) 
                    FROM   employees);
    

提交回复
热议问题