Skip to content
Advertisement

subquery to find the max of a sum

I have a sales table that contains

I want to find the store with the highest amount of sales per year. For example

My sub query works but I can’t find the max of it

Advertisement

Answer

Use row_number():

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