I have three tables.
student(stud name,stud id)
subject(subid,subname)
stud details(stud name,stud id,sub name,marks)
I want to write a query or a stored procedure in sql server
such that the output should be a table
say any A1(stud name,sub1,sub2,sub3,total)
here sub1,sub2,sub3 are row values of sub name column in subject table.
I don want to use pivot and max here.
please provide me a query with joins and case.
Thanks