Posted by Bhumin, March 9, 2022, 3:33 p.m.
#40
Hello,
Can someone help me understand why this solution isn't right?
with most_rented as(
select film_id, count(*) as cnt
from rental
inner join inventory
on rental.inventory_id = inventory.inventory_id
where extract(year_month from rental_ts) = 202006
group by film_id
order by cnt desc
limit 2)
select film_id, title from film where film_id in (select film_id from most_rented)
Can someone help me understand why this solution isn't right?
with most_rented as(
select film_id, count(*) as cnt
from rental
inner join inventory
on rental.inventory_id = inventory.inventory_id
where extract(year_month from rental_ts) = 202006
group by film_id
order by cnt desc
limit 2)
select film_id, title from film where film_id in (select film_id from most_rented)
This question is closed