I have 2 tables Awards_Nominations
and custom_1
, and I need to update Awards_Nominations.Add14
column with the concatenations of custom_1.awardNames
.
Conditions should have :
Add1 >= GPA
Majors like Add3 or 'AllMajors'
AcademicReq like Add2 or 'High School Student'
Universities like Add4 or 'AllUniversities'
I tried with the update statement inner join but it does not update.
UPDATE [dbo].[Awards_Nominations]
SET Add14=Add14+','+awardName
from [Awards_Nominations] a
inner join custom_1 on right([Add1],3)>=GPA and (Majors like '%'+Add3+'%' or Majors='AllMajors')
and (AcademicReq like '%'+Add2+'%' or 'High School Student' like '%'+AcademicReq+'%') and (Universities like '%'+Add4+'%' or Universities='AllUniversities')
where n_AwardID=4 and ApprovalStatus='final' and Add1<>''
GO
My end goal is to have something like below: