SQL OR Operator
Syntax
The OR operator in SQL is used to combine two or more conditions. At least one condition must be TRUE for a row to be included in the result.
SELECT column1, column2FROM table_nameWHERE condition1 OR condition2;Example
-- Using a single ORSELECT name, departmentFROM employeesWHERE department = 'HR' OR department = 'Sales';/* Output:| name | department ||------------|------------|| John Doe | Sales || Alice Brown| HR |*/
-- Using two ORsSELECT name, departmentFROM employeesWHERE department = 'HR' OR department = 'Sales' OR age > 40;/* Output:| name | department ||-------------|------------|| John Doe | Sales || Alice Brown | HR |*/