0

SQL - MIN Question

Why the following is wrong? SELECT firstname, lastname, MIN(salary) AS salary FROM employees; When I ran it, it indicates: ERROR: column "employees.firstname" must appear in the GROUP BY clause or be used in an aggregate function LINE 1: SELECT firstname, lastname, MIN(salary) AS salary FROM emplo...

23rd Dec 2020, 12:51 PM
YANG Fei
YANG Fei - avatar
1 Answer
+ 2
if you write select list ,but you don’t write firstname,lastname,Min(Salary),i think it will be right . you understand?
23rd Dec 2020, 2:26 PM
Garnik
Garnik - avatar