This post has some figures on execution times. The poster states:
The first query shows 49.2% of the batch while the second shows 50.8%, leading
one to think that the subquery is marginally faster.
Now, I started up Profiler and ran both queries. The first query required
over 92,000 reads to execute, but the one with the join required only 2300,
leading me to believe that the inner join is significantly faster.
There are conflicting responses though:
My rule of thumb: only use JOIN's if you need to output a column from the
table you are join'ing to; otherwise, use sub-queries.
and this:
Joining should always be faster - theoretically and realistically. Subqueries
- particularly correlated - can be very difficult to optimise. If you think
about it you will see why - technically, the subquery could be executed once
for each row of the outer query - blech!
I also agree with Madhivanan, if the sub query returns anything but one value your main query will fail, so use IN
instead.