如何用sql将两个字段的值合并起来赋给其中的一个值?

2025-01-20 00:59:53
推荐回答(3个)
回答1:

update B b1 set column2 = (
select b2.column2 || '.' || c1.column2
from B b2, C c1
where b1.column1 = b2.column1
and b2.column1=c1.column1
)

回答2:

access:
update b INNER JOIN c on b.column1 = c.column1 set b.column2 = c.column2 & '.' & b.column2

sqlsever:
update b INNER JOIN c on b.column1 = c.column1 set b.column2 = c.column2 + '.' + b.column2

回答3:

你用的是SQL Server还是Oracle?