sql - Update Multiple Rows using CASE statement -


this trying do. have columns deliberately left blank in table staging_x , updated later. update columns using case conditions below. want implement in stored procedure.

update staging_x     set staging_x.[nomaterial]       (select (case                   when ((([up]+[test])+[mon])+[down_percentage])*(1.68)=(0)                   (168) else [lost]*(1.68)                 end)           staging_x) 

update staging_x  set [nomaterial] =      case when [up]+[test]+[mon]+[down_percentage]=0      168 else [lost]*1.68 end [nomaterial] null 

Comments