• homebrew01 (10/6/2013)


    What if you want to include non-matches against T3 ? Would you add to the WHERE clause ?

    and T3.COL1 is NULL

    and T3.COL2 is NULL

    and T3.COL3 is NULL

    and T3.COL4 is NULL

    I guess it depends on what you are actually trying to do but if any of the t3 columns are NULL, they won't match any of the t2 columns even if they are also NULL so the result is that the rows won't exist and the WHERE NOT EXISTS will still work.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)