I want to ask a question about how to write a query to get the desired output?
.
There's a single dataset containing five columns Date
, Movie
Title
, Revenue
, Budget
, and Profit
(Calculated from Revenue-Budget).
Now, I wanted to extract the maximum profit earned by the movie in a year. I want to show the Year, Movie Title (with maximum profit), Budget, Revenue, and Profit, and I want one movie with each year. My desired output would be like "Most profitable movie of each year"
How to formulate the query? I am trying but I am getting multiple movies in the same year.