작성
·
250
1
안녕하세요, SQL 강의 잘 듣고 있어요 :)
다름 아니라 이 문제에서 왜 group by 를 써서 아래처럼 작성해주는지 이해가 잘 가지 않습니다.
SELECT country.continent
, FLOOR(AVG(city.population))
FROM city
INNER JOIN country ON city.countrycode = country.code
GROUP BY country.continent
처음에 group by 없이 코드를 짰더니 아래같은 에러코드가 나타났습니다.
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP BY country.continent' at line 5
자세한 설명 한 번 부탁드리겠습니다.
감사합니다.