SQL TutorialLesson 8Free preview
SQL Or
This lesson is part of SQL · All levels
Summary
OR operator returns a line that meets at least one of the combined conditions. Unlike AND, which requires all the conditions, OR is more loose because only one condition fits. ORs are often combined with parentheses to construct layered filters.
Key points
- OR returns a line that meets at least one condition.
- OR represents the logical union or union of two sets.
- Priority AND is higher than OR, so use the curve if you're in doubt.
- OR can draw many extra lines; make sure the logic is desirable.
- For a long list of values, IN is often more concise than many ORs.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.