SQL OR Statement

The SQL OR statement uses the OR operator to return records where either the first condition or second condition set is true. It is usually used together with the WHERE clause.

SQL OR statement

SELECT column_name(s)

FROM table_name

WHERE column_name operator value

OR column_name operator value


Database Table “Members”

Id FirstName LastName Email City Phone
1 Gilbert Duncan [email protected] Newark 973-600-3300
2 Elvis Daniels [email protected] Piscataway 862-600-3050
3 Michael Green [email protected] Detroit 732-500-5050
4 Kelvin Graham [email protected] Detroit 732-555-5050

SQL OR Example

SELECT *

FROM Members

WHERE City=’Newark’

OR FirstName=’Elvis’

RESULT of SQL OR statement above will be

Id FirstName LastName Email City Phone
1 Gilbert Duncan [email protected] Newark 973-600-3300
2 Elvis Daniels [email protected] Piscataway 862-600-3050