Difference between revisions 514271813 and 527411422 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)DELETE
FROM   mytable
WHERE  mycol IS NULL OR mycol = 100
</source>

The proper syntax for writing SQL Where clause<ref>{{cite web |title=SQL Where video tutorial|url=http://www.sqlserver-training.com/sql-where-video-tutorial/}}</ref> is 

<
font color="#0000ff" size="4">SELECT <font color="#ff0000" size="2span style="color:blue; font-size:140%;">SELECT <span style="color:red; font-size:100%;">&lt;&lt;column list&gt;&gt;</fontspan> FROM <font color="#ff0000" size="2span style="color:red; font-size:100%;">table</fontspan> WHERE <font color="#ff0000" size="2">column </font><font span style="color:red; font-size:100%;">column </span><span style="color=":#c0504d;">operatorvalue</font></fontspan></span>

== Predicates ==
Simple predicates use one of the operators <code>=</code>, <code><></code>, <code>></code>, <code>>=</code>, <code><</code>, <code><=</code>, <code>IN</code>, <code>BETWEEN</code>, <code>LIKE</code>, <code>IS NULL</code> or <code>IS NOT NULL</code>.

(contracted; show full){{DEFAULTSORT:Where (Sql)}}
[[Category:SQL keywords]]

[[cs:WHERE]]
[[no:Where (SQL)]]
[[ru:Where (SQL)]]
[[sq:Where (SQL)]]
[[uk:Where (SQL)]]