在MYSQL中如何用一个字段的值替换另一个字段的值

2025-03-23 17:04:30
推荐回答(5个)
回答1:

update b set bc1 = ( select ac1 from a where a.aid = b.bid)
where exists (select 1 from ac1 where a.aid = b.bid)

回答2:

UPDATE b
SET b.bc1=a.ac1
WHERE a.aid=b.bid

回答3:

update b,a
set b.bc1=a.ac1
where b.bid=a.id;

回答4:

update b set b.bid=a.ac1 where a.aid=b.bid

回答5:

q