DB2 v.8 z / OS中有几行更新

时间:2011-11-22 14:11:54

标签: sql db2

如何更新DB2 v8 z / OS中的多行(无合并功能)

select a.Full_Name, b.Nick from 
tableA a join tableB b on a.id = b.id

我需要:     a.Full_Name = b.Nick

据我所知,我不能那样做

update tableA join join tableB b on a.id = b.id
set a.Full_Name = b.Nick

1 个答案:

答案 0 :(得分:1)

您可以使用子查询:

update tableA a set a.full_name = (select nick from tableb b where a.id = b.id);