SQL WHERE: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 11: | Line 11: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
The <code>WHERE</code> clause may contain an arbitrary number of filter conditions separated by <code>AND</code>, <code>OR</code> and <code>NOT</code> operators, and | The <code>WHERE</code> clause may contain an arbitrary number of filter conditions separated by <code>AND</code>, <code>OR</code> and <code>NOT</code> operators, and optionally grouped together with parentheses. | ||
<font size=-1.5> | <font size=-1.5> | ||
<font color=green><b>FROM</b></font> <filter_condition> <font color=green><b>AND</b></font>|<font color=green><b>OR</b></font> <filter_condition> ... | <font color=green><b>FROM</b></font> <filter_condition> <font color=green><b>AND</b></font>|<font color=green><b>OR</b></font> <filter_condition> ... |
Revision as of 22:05, 23 May 2024
Internal
Overview
The WHERE
clause is the mechanism for filtering out unwanted data from the result set. The WHERE
clause can be used with SELECT
, UPDATE
and DELETE
, but not with INSERT
.
SELECT * FROM person WHERE person.name = 'Alice';
The WHERE
clause may contain an arbitrary number of filter conditions separated by AND
, OR
and NOT
operators, and optionally grouped together with parentheses.
FROM <filter_condition> AND|OR <filter_condition> ...
Filter Conditions
NULL in Conditions
Also see: