1126. Active Businesses ¶ SQL 1 2 3 4 5 6 7 8 9 10 11 12WITH AvgEvents AS ( SELECT business_id, AVG(occurrences) OVER(PARTITION BY event_type) AS event_avg_occurrences, occurrences FROM Events ) SELECT business_id FROM AvgEvents GROUP BY 1 HAVING SUM(IF(occurrences > event_avg_occurrences, 1, 0)) > 1;