A Non-Equi JOIN matches rows using comparison operators such as <, >, <=, >=, or BETWEEN instead of only using the equality operator.
Some relationships are based on ranges or comparisons rather than exact key matches.
Match employees to salary grades using minimum and maximum salary values.
SELECT
e.EmployeeName,
e.Salary,
g.GradeName
FROM Employees e
INNER JOIN SalaryGrades g
ON e.Salary >= g.MinSalary
AND e.Salary <= g.MaxSalary;
Used in salary classification, pricing, taxation, scoring, and historical business rules.
- Non-Equi JOIN does not require equality.
- Comparison operators define the relationship.
- BETWEEN is a common pattern.
- Overlapping ranges can create multiple matches.
- Boundary conditions should be tested carefully.
What is a Non-Equi JOIN?
It is a JOIN that uses comparison conditions other than equality to match records.
Give one example of a Non-Equi JOIN.
Matching an employee's salary to a salary grade using minimum and maximum salary values is a common example.