hi, i unable to get solution for this.
i want to add two columns

SELECT studentid as StudentId,Subjects as SubjeName,[1]as ExternalMarks,[9]as InternalMarks,subjectid,SubjectCode as SubjectCode
FROM (
SELECT SM.StudentId,SM.ExamtypeId,SM.obtainedmarks,SM.Ter mId,SM.subjectid,SBJ.subjects,SBJ.SubjectCode
FROM cmsstudentmarks SM
INNER JOIN dbo.CMSSubjects SBJ on
SBJ.subjectsid=SM.subjectid

) up
PIVOT (SUM(obtainedmarks) FOR ExamtypeId IN ([1],[9])) AS pvt
where studentid=@StudentId and TermId=@TermId