update a set a.n1 = (select b.n1 from b where a.gh = b.gh) where ...
update a set a.n1=(select b.n1 from b where a.gh=b.gh) is wrong;update a set a.n1 = (select b.n1 from b where a.gh = b.gh) where ... is wrong too;because (select b.n1 from b where a.gh=b.gh) may return multi records.
to kingman888(国王) : I am not 楼主, but thanks, for you are right. if gh in a and b are both primary key, these sql are right, if not, they are wrong. I am not sure so I was confused,I am wrong.
一个工号还能有多个人名与之对应?
if gh in a and b are both primary key, these sql are right, if not, they are wrong.
I am not sure so I was confused,I am wrong.