WHERE


The WHERE keyword specifies to the SELECT a search condition to be used to filter the rows returned in the result set. It is also used, as described earlier, to specify the legacy and outmoded outer join as indicated by the following syntax as follows:

 [ WHERE < search_condition > | < old_outer_join > ] column_name { * = | = *} column_name 

The < search_condition > placeholder refers to the search condition statement, which can be a simple equality check or can be a lot more complex, using a combination of one or more predicates and the logical operators AND, OR, and NOT.

Note 

The search condition syntax also applies to the other DML statements, such as DELETE and UPDATE.

The < old_outer_join > placeholder specifies an outer join using the legacy syntax and the WHERE clause. The *= operator specifies a left outer join, and the =* operator specifies a right outer join. It is possible to specify outer joins by using join operators in the FROM clause or by using the nonstandard *= and =* operators in the WHERE clause.

You can use both the old and new in your SELECT statement. The more modern syntax goes in the FROM clause, and the older syntax goes in the WHERE clause. The two methods, however, cannot both be used in the same statement.




Microsoft SQL Server 2005. The Complete Reference
Microsoft SQL Server 2005: The Complete Reference: Full Coverage of all New and Improved Features
ISBN: 0072261528
EAN: 2147483647
Year: 2006
Pages: 239

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net