• robertafricker (3/30/2008)


    Hi NJ,

    (this is the second one I had)

    USE Beerdrinkers

    SELECT bar

    FROM serves, likes

    WHERE serves.beer = likes.beer

    AND drinker = ‘Joe’

    If I may make a minor correction...

    SELECT bar

    FROM serves INNER JOIN likes ON serves.beer = likes.beer

    AND drinker = 'Joe'

    It's not recommended to do joins in the where clause any more. Especially since, in 2005 and higher, the old style outer join (*=) does not work.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass