A NON-EQUI JOIN matches rows using operators such as greater than, less than, BETWEEN, or other comparison conditions instead of only using equality.
Some business relationships depend on ranges or comparisons rather than exact key matches.
Assign customers to pricing bands based on their transaction amount.
SELECT
t.TransactionID,
t.TransactionAmount,
r.RiskLevel
FROM Transactions t
INNER JOIN RiskBands r
ON t.TransactionAmount BETWEEN r.MinAmount AND r.MaxAmount;
Used for pricing, salary bands, tax brackets, commission rules, risk categories, and effective-date analysis.
- NON-EQUI JOINs do not require equality.
- Comparison operators can define the match.
- BETWEEN is commonly used for range matching.
- Overlapping ranges can create multiple matches.
- They are useful for rule-based classification.
What is a NON-EQUI JOIN?
A NON-EQUI JOIN matches records using comparison conditions other than a simple equality condition.
Where are NON-EQUI JOINs useful?
They are useful for ranges such as pricing bands, salary grades, risk levels, and date-effective rules.