The SQL WHERE ClauseThe WHERE clause is used to filter records.The WHERE clause is used to extract only those records that fulfill a specified condition.WHERE Syntax
SELECT [i]column1[/i],[i] column2, …[/i]
FROM [i]table_name[/i]
WHERE [i]condition[/i];
WHERE Clause ExampleThe following SQL statement selects all the customers from the country “Mexico”, in the “Customers” table:Example
SELECT * FROM Customers
WHERE Country=’Mexico’;
Try it Yourself »
[hr]
Text Fields vs. Numeric FieldsSQL requires single quotes around text values (most database systems will also allow double quotes).
However, numeric fields should not be enclosed in quotes: Example
SELECT * FROM Customers
WHERE CustomerID=1;
Try it Yourself »
[hr]
Operators in The WHERE Clause
The following operators can be used in the WHERE clause:
[attachment=0]sql operators.png[/attachment]
Note: Use Demo database as of the previous Task