Hello,
I need some help for this issue.
I have a file with ID's. Some ID's have more than on product line.
I need to update the column [Prduct Category]as this example:
where i have [Product Line] in ('60','G5','4J','EA','G4','UW','NO') but that ID contains also ('FN','SH','SI')
and the [Sub Product Line] <> "Day 1" then for the lines that contains either ('6','G5','4J','EA','G4','UW','NO')
i have to put [Product Category]='Shared Options'
i wrote this but it doesnt work
update t1
set [Product Category]='Shared Options',
from table as t1
where exists (
select 1 from
(select distinct [ID],[Product Line]
from table
where [Product Line]in ('FN','SH','SI')
group by [ID],[Product Line]
having count(distinct [Product Line])>1) as t2
where t1.[ID]=t2.[ID])
and [Sub Product Line] NOT LIKE '%Day 1%'
and [Product Line]in ('6','G5','4J','EA','G4','UW','NO')
i put here my example with the [Prduct Category] updated.