0

SELECT release_year, country, MAX(budget) AS max_budget, FROM films GROUP BY country ORDER BY release_year;

I cant tell what is wrong with the above query as it keeps returning error

I have looked for errors in spelling. I have also checked the field names against the data.

Shadow
  • 33,525
  • 10
  • 51
  • 64
  • 1
    Please add the error message in full and review https://dev.mysql.com/doc/refman/8.0/en/group-by-handling.html – P.Salmon Apr 14 '23 at 15:47
  • 1
    It looks like you have an extra comma, just before your `FROM` – Rob Eyre Apr 14 '23 at 15:50
  • also, you are grouping by country but selecting release_year, and there are likely more than one release_year for each country; which do you want? make it min(release_year) or max(release_year) (in the select and order by) or change to `group by country, release_year` – ysth Apr 14 '23 at 16:09

0 Answers0