any and in operator

PHOTO EMBED

Wed Apr 13 2022 08:05:30 GMT+0000 (Coordinated Universal Time)

Saved by @Bambibo9799

-------------------- ANY OPERATOR
SELECT
    title,
    category_id
FROM
    film
INNER JOIN film_category
        USING(film_id)
WHERE
    category_id = ANY(
        SELECT
            category_id
        FROM
            category
        WHERE
            NAME = 'Action'
            OR NAME = 'Drama'
    );


-------------- IN OPERATOR
SELECT
    title,
    category_id
FROM
    film
INNER JOIN film_category
        USING(film_id)
WHERE
    category_id IN(
        SELECT
            category_id
        FROM
            category
        WHERE
            NAME = 'Action'
            OR NAME = 'Drama'
    );
content_copyCOPY