mysql - SQL: Must appear in the GROUP BY clause or be used in an aggregate function -
i have table displays teams salaries , want display minimum, maximum , average salary each team each year.
my table looks like:
i run following sql:
select min(salary), max(salary), avg(salary), teamid, yearid salaries;
but following error:
error: column "salaries.teamid" must appear in group clause or used in aggregate function
what mean?
select min(salary), max(salary), avg(salary), teamid, yearid salaries group teamid, yearid;
Comments
Post a Comment