informix多表关联更新
informix数据库中,假设A表字段type1,code1,name1,biaozhi。B表字段type2,code2,name2现在想实现如果A表的type1=B表的type2 and A表的code1=B表的code2,那么更新A表的标志。这个句子该怎么写?
求大神!
update A set biaozhi where A.code1=B.code2 and A.type1=B.type2;
这个句子肯定是错误的,但是想按照这个思路来处理。 麻烦哪个大神受累给看看 你用merge into using语句试试呢?
你表A和表B,中间总要有关联吧?
merge into 表A a using 表B b
on a.XXX=b.XXX
when matched then
update set a.A.code1=B.code2
set A.type1=B.type2;
页:
[1]