I need help with SQL Server query. I need to extract only the top 1 profitable movie for each decade.
Suppose there are 20 distinct decades and I only want to extract the top 1 profitable movie for each decade. Can someone help me with the query?
I have attached the screen shot for the reference. My result shows all the profitable movies for each decade. I only want the top 1 profitable movie for each decade.
For reference enter image description here
Select
decade, Movie_Title, Profit
from
DW.IMDB_MOVIE
group by
decade, Movie_Title, profit
order by
decade, profit desc