Best Selling Movies
Tarefa
Swipe to start coding
For each cinema, let's order movies from the most selling to the least one. Print records in the following format: cinema_id
, movie_id
, sales
(for total sales). Remember to order records by cinema's first but by total sales then (starting with the best selling one).
Solução
select s.cinema_id as cinema_id, s.movie_id as movie_id, sum(s.sales) as sales
from schedule as s
group by cinema_id, movie_id
order by cinema_id, sales desc
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 1. Capítulo 4
No query executed yet... |