Open veangous opened 4 years ago
SELECT distinct c.customer_id, a.actor_id, a.first_name, a.last_name, c.first_name, c.last_name, count(r.rental_id) as number_rentals
FROM actor a, film_actor fa, customer c, film f, inventory i, rental r
WHERE i.film_id = f.film_id AND fa.film_id = f.film_id AND r.customer_id = c.customer_id AND fa.actor_id = a.actor_id AND r.inventory_id = i.inventory_id
group by c.customer_id, a.actor_id
SELECT distinct c.customer_id, a.actor_id, a.first_name, a.last_name, c.first_name, c.last_name, count(r.rental_id) as number_rentals
FROM actor a, film_actor fa, customer c, film f, inventory i, rental r
WHERE i.film_id = f.film_id AND fa.film_id = f.film_id AND r.customer_id = c.customer_id AND fa.actor_id = a.actor_id AND r.inventory_id = i.inventory_id
group by c.customer_id, a.actor_id