No, it's ok to use.
You can write the query above using IN, EXISTS in all RDBMSs, some also support INTERSECT.
Semantically, this is a semi-join, which "give me the rows from table A, where I have at least one match in table B." INNER JOIN - "give me all the relevant lines"
So, if TableA has 3 rows and TableB has 5 rows that correspond to:
- INNER JOIN - 15 lines
- half connection is 3 lines
This is why IN and EXISTS are being pushed by me and other types of SQL here: JOIN is erroneous, requires DISTINCT and will be slower.
EXISTS supports multiple JOIN columns, IN does not work in SQL Server (this happens in others).
gbn
source share