How can I change this following code from WHERE NOT EXISTS to ANY
SELECT
CategoryName
FROM
Categories
WHERE
NOT EXISTS (SELECT *
FROM Products
WHERE Categories.CategoryID = Products.CategoryID)
My goal was to show which category names have no products associated with them. Please comment if you need a schema.
If you need to use any
then just negate it with not
select CategoryName
FROM Categories
where not (categoryId = any (select CategoryId from products))