Easy SQL Challenge: Using UNION

365 Days of Daily Coding: Day 67

I met my friends after a long time and had good chat with them. Basically ranting about our work life and also so called ‘quarter life crisis’. My group of friends are literally the best way to release all my stresses and have a good laugh at the end of the day.

I solved an easy sql challenge in SQLpad today using union.

SELECT COUNT(DISTINCT actor_id)
FROM (
SELECT actor_id
FROM actor_movie 
UNION 
SELECT actor_id 
FROM actor_tv) AS k;

Leave a comment