• Hugo Kornelis (3/21/2012)


    KWymore (3/21/2012)


    Are there any instances where you could not perform the same logic using IN instead of ANY?

    Yes, as GSquared already shows.

    However, there are (as far as I know) no cases where an ANY or SOME could not be replaced by an equivalent EXISTS subquery.

    There are always alternatives to any particular query syntax. These options (Any/Some/All) can make a query significantly more readable than some complex Exists subqueries, in the right cases.

    I haven't tested them for performance, nor have I used them with any frequency, so can't speak to that point, but a QotD that highlights a less-known feature for possible use, is perfectly valid.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon