Best way to include AND exclude? I have a large table that contains product IDs and product category IDs.

I want to select product IDs that are in a certain list of category IDs, AND exclude the product ID entirely if it's in another list of category IDs.

Example table:

prod_id cat_id
------- ------
1       10
1       11
2       10
2       11
2       12
3       10
3       11


So I want to see all products that have category IDs 10 and 11, BUT if they are also have category ID 12, they must be excluded.

I was thinking this would work, but it does not:

SELECT prod_id from products WHERE cat_id IN (10,11) AND NOT IN (12)


This seems like it should be really easy and common, but I'm just not getting it.
You can use NOT EXISTS for this purpose.

SELECT DISCTINCT
    prod_id
FROM
    products p1
WHERE
    cat_id IN (10, 11)
    AND NOT EXISTS (SELECT 1
                    FROM   products p2
                    WHERE  p1.prod_id = p2.prod_id
                           AND cat_id = 12);