Головна‎ > ‎SQL‎ > ‎

WHERE

WHERE - де виконується умова


SELECT * FROM Customers
WHERE Country='Mexico';

CustomerID>=50
CustomerID=1




Price <> 18   // не 18




Price BETWEEN 50 AND 60;




City LIKE 's%';   // починається з s чи S




City IN ('Paris', 'London');   // Paris або London







SELECT SupplierName
FROM Suppliers
WHERE EXISTS (SELECT ProductName FROM Products WHERE Products.SupplierID = Suppliers.supplierID AND Price < 20);




SELECT SupplierName
FROM Suppliers
WHERE EXISTS (SELECT ProductName FROM Products WHERE Products.SupplierID = Suppliers.supplierID AND Price = 22);