读书人

求将A表某个字段update到B表的SQL话语

发布时间: 2013-01-04 10:04:14 作者: rapoo

求将A表某个字段update到B表的SQL语句
表A、表B共有字段X,

现要update表B的字段Z=表A的字段Y

求sql语句
[解决办法]
试试
update b set z=(select y from a where a.x=b.x)
[解决办法]

引用:
试试
update b set z=(select y from a where a.x=b.x)


这个sql语句select y from a where a.x=b.x中查出的y值必须是唯一值才可以,如不是唯一值,需要在Where中添加条件。

读书人网 >Informix

热点推荐