Ok great. I kinda assumed you would know where to choose the Advanced SQL option in the web report. Instructions with screenshots available in this KB
Any field in a SELECT statement that is not aggregated (MIN, MAX, etc) must be present in the GROUP BY. Those are the SQL rules