OR
BrandonDusch580 total contributions
Published Jun 11, 2021Updated Aug 18, 2022
Contribute to Docs
The OR
operator tests if any condition in a given expression evaluates to TRUE
.
Syntax
SELECT column_name
FROM table_name
WHERE condition1
OR condition2
...
OR conditionN;
If any of the condition_
s evaluate to TRUE
, the row(s) can be returned. However, if all of the condition_
s were to evaluate to NOT TRUE
, then the row(s) would not be returned from the query.
Example 1
To query for records where item_name
is equal to 'brush'
or 'gloves'
in the inventory
table:
SELECT *FROM inventoryWHERE item_name = 'brush' OR 'gloves';
Example 2
To query for records where item_name
is equal to 'plunger'
or 'soap'
or 'wipes'
in the inventory
table:
SELECT *FROM inventoryWHERE item_name= 'plunger' OR 'soap' OR 'wipes';
All contributors
- BrandonDusch580 total contributions
- christian.dinh2476 total contributions
- Anonymous contributorAnonymous contributor3071 total contributions
- Anonymous contributorAnonymous contributor186 total contributions
- BrandonDusch
- christian.dinh
- Anonymous contributor
- Anonymous contributor
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.