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