Question: how can i write this to give me 0 instead of NULL in the total_combined_film_length column? SELECT actor.actor_id AS actor_id, actor.first_name AS first_name, actor.last_name AS
how can i write this to give me 0 instead of NULL in the total_combined_film_length column?
SELECT actor.actor_id AS actor_id, actor.first_name AS first_name, actor.last_name AS last_name, animation.total_combined_film_length FROM actor actor LEFT JOIN ( SELECT act.actor_id AS actor_id, SUM(film.length) AS total_combined_film_length FROM actor act INNER JOIN film_actor film_actor ON act.actor_id=film_actor.actor_id INNER JOIN film film ON film_actor.film_id=film.film_id INNER JOIN film_category fc ON film.film_id=fc.film_id INNER JOIN category category ON fc.category_id=category.category_id WHERE category.name='animation' GROUP BY act.actor_id ASC ) AS animation ON actor.actor_id=animation.actor_id
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
