반응형
WHERE clause is uesed to filter records.
It is used to extract only those records that fulfill a specified conditon.
SELECT column1, column2
FROM table_name
WHERE condition ;
WHERE is also can use in UPDATED, DELECT and ETC
If demo database goes like this
SELECT CustomerName FROM Customers WHERE City = "London"
Also WHERE statement can use additional operator
Operator | Descripitoin |
= | equal |
> | Greater than |
< | Less than |
>= | Greater than or equal |
<= | Less than or equal |
<> / != | NOT equal |
BETWEEN | between a certain range |
LIKE | Search for a pattern |
IN | to specify multiple possible values for a column |
SELECT * FROM Customers
WHERE City IN ('Paris', 'London')
SELECT * FROM Products
WHERE Price BETWEEN 50 AND 60;
반응형