A NON-EQUI JOIN matches records using operators such as greater than, less than, greater than or equal to, or less than or equal to instead of only using equality.
Many business relationships depend on ranges, thresholds, or comparisons rather than exact matching values.
Match employee salaries with salary bands using minimum and maximum salary values.
SELECT
e.EmployeeName,
e.Salary,
b.BandName
FROM Employees e
INNER JOIN SalaryBands b
ON e.Salary >= b.MinSalary
AND e.Salary < b.MaxSalary;
Used in pricing, salary bands, taxation, commission calculations, risk scoring, and time-period analysis.
- NON-EQUI JOIN does not depend only on =.
- Comparison operators can define relationships.
- Range matching is a common use case.
- Overlapping ranges can create duplicate matches.
- Boundary conditions require careful testing.
What is a NON-EQUI JOIN?
A NON-EQUI JOIN matches records using comparison conditions other than simple equality.
Give one example of a NON-EQUI JOIN.
Matching an employee salary to a salary band using minimum and maximum salary conditions is a common example.