Difference between revisions 644253488 and 648611723 on enwiki

{{Refimprove|date=September 2014}}
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. In brief SQL WHERE clause is used t(contracted; show full)FROM   mytable
WHERE  mycol > 100 AND item = 'Hammer'
</source>

=== IN ===
<code>IN</code> will find any values existing in a set of candidates.
<source lang="sql">
SELECT ename WHERE enam
 nne IN ('value1', 'value2', ...)
</source>
All rows match the predicate if their value is one of the candidate set of values. This is the same behavior as
<source lang="sql">
SELECT ename WHERE ename='value1' OR ename='value2'
</source>
except that the latter could allow comparison of several columns, which each <code>IN</code> clause does not. For a larger number of candidates, <code>IN</code> is less verbose.

(contracted; show full)
== References ==
<references />

{{SQL}}

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