Difference between revisions 478086737 and 478086988 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 should be used to limit the number of rows affected by a SQL DML statement or returned by a query.

==Overview==
(contracted; show full)The following [[Delete (SQL)|<code>DELETE</code> statement]] removes only those rows from table ''mytable'' where the column ''mycol'' is either NULL or has a value that is equal to 100.
<source lang="sql">
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="2">&lt;&lt;column list&gt;&gt;</font> FROM <font color="#ff0000" size="2">table</font> WHERE <font color="#ff0000" size="2">column </font><font color="#c0504d">operatorvalue</font></font>

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

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