whats the difference between..
select a.value1
from apple a, banana b, oranges o
where a.value1 = b.value1 and o.value1 = a.value1 and o.value2 = 'oranges';
compared to
select a.value1
from apple a
where a.value1 in (
select b.value1
from banana b, oranges o
where b.value1 = o.value1 and o.value2 = 'oranges';
);
is there really a difference?
The first one MAY show values from table a more than once, if the join conditions a x b x c result in multiple rows.
The second one will only show values from the table a once (since it tests to see if it is “in the list from the subquery”)
Since you are just starting out with SQL, allow me to rephrase your query using ANSI SQL92 syntax, and also the EXISTS clause which is the alternative to IN (but may optimize differently)