The WHERE clause is used to filter records.
The WHERE clause is used to extract only those records that fulfill a specified criterion.
The "Persons" table:
Now we want to select only the persons living in the city "New Orleans" from the table above.
We use the following SELECT statement:
The result-set will look like this:
SQL uses single quotes around text values (most database systems will also accept double quotes).
Although, numeric values should not be enclosed in quotes.
For text values:
For numeric values:
With the WHERE clause, the following operators can be used:
Note: In some versions of SQL the <> operator may be written as !=
Your Query was successfully sent!