sql server - update specific rows on table1 with specific values when table1 matches table2 and table 2 row contains a specific level -


i've tried search i'm not getting proper criteria valid search return. if show this, have answer. in sql server.
doesn't work, here trying do.

    update rating r      set category1 = 1000,         category2 = 500,         category3 = 100     yearnbr = 2014 , weeknbr = 0     , (select * team t r.teamnbr = t.teamnbr , t.tierlevel = 1)  rating has:     teamnbr int,     yearnbr int,     weeknbr int,     category1 int,     category2 int,     category3 int  team has:     teamnbr int,     teamname varchar(50),     tierlevel int 

basically, need update rating table specific values rows have yearnbr of 2014 , weeknbr of 0, , want rows have tierlevel = 1 on team table matches on teamnbr both tables. have 5 different tierlevels , change category values , tierlevel in statement , run 1 time each tierlevel.

thanks in advance. robert

update  r  set r.category1 = 1000,     r.category2 = 500,     r.category3 = 100 rating r  inner join team t on r.teamnbr = t.teamnbr                   , t.tierlevel = 1 r.yearnbr = 2014 , r.weeknbr = 0 

Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -