Why does query fail if GROUP BY is placed before WHERE clause?


#1

In part 3 of the Aggregate Functions, question 1 asks:
"Count the total number of apps at each price that have been downloaded more than 20,000 times. In the code editor type"

The correct code is:
SELECT price, COUNT(*) FROM fake_apps
WHERE downloads > 20000
GROUP BY price;

My question is why does the query fail if GROUP BY is placed before WHERE clause?


#2

@webrockstar41446,
Do a google search
== discussions / opinions ==
sql why should group by be placed after where clause site:stackoverflow.com
and have a read through some of the Posts....