Difference between revisions 582756202 and 582862177 on enwiki

{{Unreferenced|date=April 2007}}
A <code>WHERE</code> clause in [[SQL]] specifies that a SQL [[Data Manipulation Language|Data Manipulation Language (DML)]] statement should only affect rows that meet specified criteria. The criteria are expressed in the form of predicates. <code>WHERE</code> clauses are not mandatory clauses of SQL DML statements, but can be used to limit the number of rows affected by a SQL DML statement or returned by a query.

==Overview==
(contracted; show full)
<source lang="sql">
SELECT ename FROM emp WHERE ename LIKE '%A_E%';
</source>
*Character Classes<ref>''[http://technet.microsoft.com/en-us/library/ms179859.aspx Microsoft Technet]''Retrieved 21 November 2013.</ref>	
**Find any string that starts with a letter or number or the symbol '_'
<source lang="sql">
SELECT ename FROM emp WHERE ename LIKE '[a-z
A-Z0-9_]%';
</source>
SQL programmers need to be aware that the LIKE predicate typically performs a search without the normal performance benefit of indexes. Using '=', '<>', etc.. instead will increase performance.  Users of the LIKE predicate should be aware that case sensitivity (e.g., 'S' versus 's') may be different based upon database product or configuration.

== External links ==

# [http://www.psoug.org/reference/conditions.html PSOUG Home Puget Sound Oracle Users Group] gives several examples of SELECT statements with WHERE clauses.

== References ==
<references />

{{SQL}}

{{DEFAULTSORT:Where (Sql)}}
[[Category:SQL keywords]]