WHERE
row filter
What changes
- Input
- rows from FROM/JOIN
- Output or change
- rows where the condition is TRUE (FALSE and UNKNOWN drop)
Syntax at a glance
[ WHERE <search_condition> ]
Work example
A detail report should keep values that meet a row-level condition before grouping.
Run the sample with a matching value, a nonmatch, and NULL. Then compare the result with the predicate written in plain language.
Check your work WHERE. Only the value 2 remains. NULL does not make the WHERE condition true.
Practice SQL
Open in SQL FlowSELECT Value
FROM (VALUES (1), (2), (NULL)) AS Items(Value)
WHERE Value >= 2;
Open Microsoft Learn for full syntax, permissions, and details for your version.