• vshiva2379 (7/28/2013)


    Execuse me

    Since you did not understand i how given that data and more over i do not want to disclose my original data i have given that, if you insist then have a look

    Create table Student(Studentid int,name varchar(50),maths int,science int,com int)

    insert into Student values(1,'Allen',40,50,89)

    insert into Student values(2,'John',70,90,89)

    insert into Student values(1,'Nick',90,80,89)

    Thank you

    Heh... if I insist. 😀 It's your question, bud. Look how fast people responded when you posted it in a readily consumable format.

    The question now is, do you actually understand the code that gave you the desired answer?

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