"if you encounter any errors in SAP, send me a screenshot at pramod@learntosap.com, and I will help you resolve the issue."

SQL OR Operator Explained with Examples | Learn SQL Conditions Easily

SQL TUTORIALS-

SQL OR Operator Statement

Introduction-


Trulli Trulli

SQL OR Operator Explained with Examples | Learn SQL Conditions Easily

When Use SQL OR operator is used to filter records where at least one of the specified conditions is true.


Emoji Examples in HTML

🔸 Example Table: Employees

ID Name Department Salary
1 ANNI IT 10000
2 POOJA IT 90000
3 RAJ SALES 5000

✅ Example-1:- Returns rows where department is either IT or Sales.:


SELECT * FROM Employees
WHERE Department = 'IT' OR Department = 'Sales';

Result Show :-

Emoji Examples in HTML

🔸 Example Table: Employees


ID Name Department Salary
1 ANNI IT 10000
2 POOJA IT 90000
3 RAJ SALES 5000

✅ Example-2:- Returns rows where salary > 10000 or department is SALES.:-

SELECT Query :-


SELECT * FROM Employees
WHERE Salary > 10000 OR Department = 'SALES';

Result Show :-

Emoji Examples in HTML

🔸 Example Table: Employees

ID Name Department Salary
1 ANNI IT 10000
3 RAJ SALES 5000

✅ Example-3:- Returns records where name is ANNI or RAJ.:-

SELECT Query :-


SELECT * FROM Employees
WHERE Name = 'ANNI' OR Name = 'RAJ';

Result Show :-

Emoji Examples in HTML

🔸 Example Table: Employees

ID Name Department Salary
1 ANNI IT 10000
3 RAJ IT 5000

May Be Like Important Link-

-SQL Tutorial for Beginners – Introduction to SQL

-SQL TOP, LIMIT, FETCH FIRST or ROWNUM Clause

-SQL SELECT DISTINCT Statement Clause Explained with Examples

-SQL Wildcard Characters: Complete Guide with Examples