Victor
Victor

Reputation: 17097

Having a between operator in the inner join where clause

Does this query amount to an inner join:

select * from a, b where a.start_date between b.start_date and b.end_date;

It seems so but I am confused because I always tend to think that an inner join has to have an = operator in the where clause as opposed to a 'between' operator

Upvotes: 0

Views: 207

Answers (2)

radar
radar

Reputation: 13425

use JOIN instead of , separated tables

the same condition with join looks like this

select * from a
JOIN b ON  a.start_date between b.start_date and b.end_date;

Upvotes: 1

Jeffrey Wieder
Jeffrey Wieder

Reputation: 2376

Yes. The actual check means nothing to the join other than ensuring proper association and not brining in all results.

Upvotes: 0

Related Questions