• sqlfriends (11/9/2011)


    Ninja's_RGR'us (11/9/2011)


    Well you could do it like this if you wanted to =>

    FROM SchoolProgram srp

    INNER JOIN @Programs pr ON srp.ProgramID = 7

    Thanks, so above statement, for inner join it doesn't need to join on a matched column?

    To be a proper join, it does. Ninja's example is not a join, it's a filter on a cross join, It's this:

    FROM SchoolProgram srp

    CROSS JOIN @Programs pr

    WHERE srp.ProgramID = 7

    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