The WHERE clause is used to extract only those records that fulfill a specified criterion.
Syntax :
SELECT column_name(s)
FROM table_name
WHERE column_name operator value
Example :
SELECT aircraft_code from flight_detials
WHERE fair >5000
NOTE :- SQL uses single quotes around text values.Although, numeric values should not be enclosed in quotes.
Operators Allowed in the WHERE Clause
With the WHERE clause, the following operators can be used:
Operator Description
= Equal
<> Not equal
> Greater than
< Less than
>= Greater than or equal
<= Less than or equal
BETWEEN Between an inclusive range
LIKE Search for a pattern
IN If you know the exact value you want to return for at least one of the columns
Note: In some versions of SQL the <> operator may be written as !=
The WHERE clause is used to extract only those records that fulfill a specified criterion.
Syntax :
SELECT column_name(s) FROM table_name WHERE column_name operator value |
SELECT aircraft_code from flight_detials
WHERE fair >5000
NOTE :- SQL uses single quotes around text values.Although, numeric values should not be enclosed in quotes.
WHERE fair >5000
Operators Allowed in the WHERE Clause
With the WHERE clause, the following operators can be used:
Operator | Description |
---|---|
= | Equal |
<> | Not equal |
> | Greater than |
< | Less than |
>= | Greater than or equal |
<= | Less than or equal |
BETWEEN | Between an inclusive range |
LIKE | Search for a pattern |
IN | If you know the exact value you want to return for at least one of the columns |
Note: In some versions of SQL the <> operator may be written as !=
No comments:
Post a Comment