Hi, Is there a way to update multiple columns using Set statement.
like:
Update table1 set (a,b,c,d,e,f,g,h,i,j,k)=
(t2.a,t2.b,t2.c,t2.d,t2.e,t2.f,t2.g,t2.h,t2.i,t2.j,t2.k)
from table2 t2
where table1.id=table2.id
I am attaching my code below. I am not sure it would be relevant or not. This definetly gives a lot of Errors.
proc sql;
update inlib.Video_News
set network= T2.Network, VideoFormat=VideoFormat, DistnChannel= DistnChannel, Platform= Platform, Quarter=T2.Quarter, Budget=T2.Budget_Capacity11
from (select a.network, b.Videoformat, b.distnchannel, b.Platform, a.Quarter, a.device, (budget* Capacity_pct) as Budget_Capacity11
from inlib.Video_News a
left join (select c.*, (Budget_Capacity/Capacity_tot) as Capacity_Pct
from inlib.Cap_News c
left join ( select Quarter, Network, distnChannel, VideoFormat, Platform,device, sum(Budget_Capacity) as Capacity_Tot
from inlib.Cap_News
where upcase(device)= 'OTT'
group by Quarter, network, device)d
on upcase(c.Quarter)= upcase(d.Quarter)
and upcase(c.Network)= upcase(d.Network)
and upcase(c.VideoFormat)= upcase(d.VideoFormat)
and upcase(c.Distnchannel)= upcase(d.Distnchannel)
and upcase(c.Platform)= upcase(d.Platform)
and upcase(c.Device)= upcase(d.Device)
where upcase(c.device)= 'OTT') b
on compress(upcase(a.device)) = compress(upcase(b.Device))
and compress(upcase(a.Network))= compress(upcase(b.Network))
and compress(upcase(a.Quarter))=compress(upcase(b.Quarter))
order by a.network, b.Videoformat,b.distnchannel, b.Platform,a.Quarter, a.device) T2
where compress(upcase(device)) = compress(upcase(T2.Device))
and compress(upcase(Network))= compress(upcase(T2.Network))
and compress(upcase(Quarter))=compress(upcase(T2.Quarter))
;
quit;
... View more