I am new to sql. I have a stored procedure where I need to add two columns which is of Table "dbo.AdditionProjectDetails". Here ProjectID is the primary key. Below is the code snippet as I cant add the whole here. Any help?
SELECT PBD.Proj_ID, case when Phase =1 then 'Phase I' when Phase=2 then 'Phase II'
Tasktype,Area_Name,ProjectName,OS_Name,PTCDD.Remarks
FROM ProjectDetails (NOLOCK) PBD
inner join ProjectTestProcessDetails (NOLOCK) PTPD on PBD.Proj_ID =PTPD.Proj_ID
inner join ProjectTestCycleDet (NOLOCK) PTCD on PTCD.Proj_ID=PBD.Proj_ID
inner join ProjectTestCycleDuration (NOLOCK) PTCDD on PTCDD.Proj_ID=PBD.Proj_ID
inner join ProjectTestProcessCostDetails (NOLOCK) PTPCD on PTPCD.Proj_Test_PrepareID=PTPD.Proj_Test_PrepareID
inner join AreaMaster Am on Am.Area_ID =PBD.AreaID
inner join ProjectMaster PM on PM.ProjectID =PBD.PlatformID
inner join OSMaster OS on OS.OS_ID =PBD.OSID
where Status in ('S','R','C') and Tasktype,Area_Name,ProjectName,OS_Name,PTCDD.Remarks
group by PBD.Proj_ID,PBD.Created_by,PBD.Created_on,status,TaskGivenDate
order by PTCD.TaskEndDate DESC