• coolcurrent4u (2/8/2016)


    Hello

    see an sql fiddle http://sqlfiddle.com/#!3/f4be2/1

    Regards

    You should post your stuff on this site for two reasons...

    1. Your SQL Fiddle says "loading" and "Please build Schema". Its useless (for me, anyway).

    2. SQL Fiddle could easily go away which would leave this thread incomplete. Please see the first link in my signature line below for how to get the best help.

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