• SqlServerLover (3/18/2013)


    Thanks SSCrazy. Union all does not work in my case as i do not want two rows .........

    but left join worked.. thanks.

    Since you said there was no fixed key to join the 2 two results, how'd you manage to pull off a Left Join?

    --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)