Skip to content
Advertisement

What will be the query for this?

AS (

SELECT round_number ,stadium_name ,spectators FROM ( SELECT round_number ,stadium_name ,spectators ,RANK() OVER ( PARTITION BY round_number ORDER BY spectators DESC ) AS rank1 FROM t1 ) AS s1 WHERE rank1 = 1

Advertisement

Answer

I think you can just use window functions:

I don’t see why aggregation would be needed for the inner query.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement