如根据A表c字段筛选,将A表h字段update 到B表j字段,求大神解答。谢谢

如根据A表c字段筛选,将A表h字段update 到B表j字段,求大神解答。谢谢

举例:

update  t1, t2 set t1.name = t2.name where t1.id = t2.id and t2.id = 1 ;

或者

update  t1 left join  t2  on t1.id = t2.id set t1.name = t2.name where t2.id = 1

update b set j = a.h from b inner join a on <两表关联式> where a.c ...

UPDATE B SET j = A.h FROM A WHERE A.c=B.c

update B set j=(select A.h from A where A.c=B.c)

where exists (select 1 from A where A.c=B.c)