• Shadab Shah (9/5/2012)


    I have 2 queries asselect id,sum(a)/count(id) as e from table1 group by id and another query as select id,sum(b)/count(id) as ffrom table2 group by id .Now i want to perform e - f. Could somebody help me please.

    Would you clarify, please? I'm assuming that you want e-f as joined on ID, correct?

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