You couldn't use IN in with this subquery, because:
- When you say
> ANY
, it returns those rows from outer query where the rating is higher than the rating of ANY of the ratings returned by the subquery. - If you would use
IN
, then it would return only those sailors who have the same rating as any of the sailor with name Horatio.
Notice that the first query may return sailors with name 'Horatio', because one sailor with a name 'Horatio' may have higher rating than another sailor with name 'Horatio'.
Also, ANY
returns FALSE
if subquery returns no rows.
Edit Ok, I didn't understand your question. You can't use < > =
etc. operators with IN
, they can only be used with ANY
, SOME
and ALL
.
Take a look here for more information: Tim Hall about ANY, SOME and ALL