loading...

re: #SQL30 Day 1: Wildfires VIEW POST

FULL DISCUSSION
 

I think my query is quite a bit easier than WINDOWing and CTE:

SELECT w1.*
FROM day1.wildfire w1
INNER JOIN ( SELECT cause, MAX(acres) as max_acres FROM day1.wildfire GROUP BY cause ) w2
ON w1.cause = w2.cause AND w1.acres = w2.max_acres;

 

Nice! I think of window functions as the heavy artillery... not always necessary when a group by might do the job.

code of conduct - report abuse