select dense_rank() over (partition by f.title order by r.rental_id desc) as film_rank,
f.title as film_title
from rental as r
join inventory as i on r.inventory_id = i.inventory_id
join film as f on i.film_id = f.film_id
where year(rental_date) = 2005
order by film_rank desc, film_title asc