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

SQL BETWEEN Operator

SQL TUTORIALS-

SQL BETWEEN Operator

Introduction-


Trulli Trulli

-✅SQL BETWEEN operator is used to filter the result set within a specific range.its also works with numeric, text, and date values.


Emoji Examples in HTML

🔸 Example Table: Employee


ID Name AGE SALARY
1 ANNI 25 20000
2 SUJAN 27 25000
3 BOULT 29 30000
4 POOJA 30 35000

✅ Example 1: Age Between 25 and 27-



SELECT * FROM Employees
WHERE Age BETWEEN 25 AND 27;

Result Show :-

Result → ANNI | SUJAN |


✅ Example 2: Salary Between 20000 and 32000-



SELECT * FROM employee
WHERE salary BETWEEN 20000 AND 32000;

Result Show :-

Result → ANNI | SUJAN | BOULT |


✅ Example 3: Employee ID Between 1 and 3-



SELECT * FROM employee
WHERE emp_id BETWEEN 1 AND 3;


Result Show :-

Result → ANNI | SUJAN | BOULT |


✅ 4. Salary NOT Between 20000 and 30000-



SELECT emp_name, salary FROM employee
WHERE salary NOT BETWEEN 20000 AND 30000;

Result Show :-

Result → POOJA |


Practice - Yes/No Quiz

1.Can you use BETWEEN with dates and text values too?

2.Can BETWEEN be used with NOT?


May Be Like Important Link-

-How To Import Data(LSMW) LEGACY SYSTEM MIGRATION WORKBENCH

-Define Condition Type-OBYZ

-Genral Ledger Chart Of Accounts-OBD4

-Document 90039783 saved (no accounting document generated)