none
Sql 2008

    Question

  • hello friends,

    i am new in server 2008,

    i have two tables 1 is Students

    structure of students table is.

    roll    sname     scity

    and second table is marks,

    structure of marks table is.

    roll sub1 sub2 sub3

    i want to get student detail and total of marks in a join query so what i do..

    Tuesday, June 25, 2013 7:40 AM

Answers

  • Its should be simple.

    Select A.Sname, B.Sub1,B.sub2, B.sub3 From Students with(nolock) Inner Join Marks with (Nolock)

    On A.roll=B.roll

    Select A.Sname, Sum (B.Sub1+B.sub2+B.sub3 ) From Students with(nolock) Inner Join Marks with (Nolock)

    On A.roll=B.roll Group by A.Sname


    Srinivasan

    • Marked as answer by Kalpesh915 Wednesday, June 26, 2013 5:56 AM
    Tuesday, June 25, 2013 8:27 AM

All replies

  • Its should be simple.

    Select A.Sname, B.Sub1,B.sub2, B.sub3 From Students with(nolock) Inner Join Marks with (Nolock)

    On A.roll=B.roll

    Select A.Sname, Sum (B.Sub1+B.sub2+B.sub3 ) From Students with(nolock) Inner Join Marks with (Nolock)

    On A.roll=B.roll Group by A.Sname


    Srinivasan

    • Marked as answer by Kalpesh915 Wednesday, June 26, 2013 5:56 AM
    Tuesday, June 25, 2013 8:27 AM
  • Thanks Mr. Srinivasan sir...

    Wednesday, June 26, 2013 5:57 AM