SQL TUTORIALS-
SQL ANY and ALL Operators
Introduction-
What is SQL ANY Operator? SQL ANY vs ALL: Key Differences
β In a Simple Word SQL, the ANY and ALL operators are used with comparison operators (like =, >, <, >=, <=, !=) to compare a value to a set of values returned by a subquery.Why this useful when comparing a single value to multiple values from another table or result set....
β Syntax Example SQL ANY Operator-
expression operator ANY (subquery)
β Syntax Example SQL ALL Operator-
expression operator ALL (subquery)
SQL ANY and ALL Operators Example Of Two Tables 1)-Employee. And 2)-Department
| EmpID | Name | DepID | SALARY |
|---|---|---|---|
| 101 | ANNI | 1 | 50000 |
| 102 | RAJ | 2 | 60000 |
| 103 | POOJA | 3 | 55000 |
| 104 | SUJAN | 4 | 70000 |
| 105 | RUPESH | 5 | 65000 |