The basic SELECT, FROM, and ORDER BY clauses are only marginally useful in building applications. Very few applications will have a requirement to return all of the data in a table, so the WHERE clause is used to limit the results returned. The filtering criteria applied to a query are known as a search argument (SARG).
The following queries are examples of a basic WHERE clause that will return a single row from the Person.Address table.
SELECT * FROM Person.Address WHERE AddressID = 102 SELECT * FROM Person.Address WHERE AddressID = 2
In addition to an equality, you can also test for >, <, >=, <=, and <>. An inequality can be written as either <> or !=. The following queries provide additional examples of a simple WHERE clause.