• yb751 (5/25/2015)


    Could you further explain why C is eliminated from your desired output? In fact we could use a little more info in general. Without knowing how A is related to B and/or C it's hard to look at your example and come up with a solution.

    Taking this statement literally:

    How to find the equal and opposite rows in a table.

    Should mean that A, B and C are all returned because they all meet your criteria.

    Probably because A has already been "consumed" by B. Think of it like debits and credits in a checkbook or inventory control system.

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