Beginner

650. Non-Equi JOIN

Understand JOINs that use operators other than equality.

📘 Lesson 650 of 728 ⏱ 15 min 🎯 Advanced

A Non-Equi JOIN uses comparison operators such as <, >, <=, >=, or <> instead of only using an equality condition.

Some relationships are based on ranges, thresholds, or comparisons rather than exact key matches.

Match employees to salary grades where their salary falls within the grade range.

SQL
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 compensation analysis, pricing, taxation, risk scoring, and threshold-based business rules.

  • Non-Equi JOINs do not require =.
  • Comparison operators define the relationship.
  • They are common in range-based logic.
  • Overlapping ranges can produce multiple matches.
  • Boundary conditions should be tested carefully.
What is a Non-Equi JOIN?

It is a JOIN that uses comparison operators other than simple equality.

Give an example of a Non-Equi JOIN.

Matching an employee salary to a salary-grade range using >= and < is a common example.

Have you finished this lesson?

Introduction to SQL – All Lessons