sql - pass 2 parameters and update a table based on the value from 2 tables that are related -


microsoft sql 2008

this 3 tables below related joined b=b , d=d want query 3 tables , update value in table 2 column3=d using declare set column1=a in table1 , declare set column2=f in table3 .once condition met update table 2 column3 value table3 column3

table 1 column1 column2 column3           b        c  table 2 column1 column2 column3  c        b      d  table 3 column1 column2 column3 e       f        d 

update table2 t2   inner join table1 t1 on t1.column2=t2.column2   inner join table3 t3 on t3.column3=t2.column3 set t2.column3=t3.column3 t1.column1='a'   , t2.column2='f' 

like this?


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -