I want to convert exist clause into In clause of the following query

158 Views Asked by At
SELECT SupplierName
FROM Suppliers
WHERE EXISTS (SELECT ProductName FROM Products 
              WHERE Products.SupplierID = Suppliers.supplierID AND Price < 20);

I want to convert the existing clause into an IN clause of the query.

1

There are 1 best solutions below

0
ORGPEV On BEST ANSWER

Here you go:

SELECT SupplierName
FROM Suppliers
WHERE Suppliers.SupplierID IN (
    SELECT Products.SupplierID
    FROM Products 
    WHERE Price < 20
)