select PC.ProductIdfrom #Product_Category as PCwhere PC.CategoryId in (200, 300, 400)group by PC.ProductIdhaving count(distinct PC.CategoryId) = 3

select PC.ProductIdfrom #Product_Category as PCwhere PC.CategoryId in (200, 300, 400)group by PC.ProductIdhaving count(distinct PC.CategoryId) = 3