求助:update
现在要做update,要求update的内容已经提出到临时表里,临时表有两个条件,一个是logno,一个是nodeno,要求update时,a.logno=b.logno 并且a.nodeno=b.nodeno,并且满足条件的数据不止一条。 给个样本数据较容易明白LZ到底在说什么 czw1413_cn 兄说得应是正解。 原帖由 czw1413_cn 于 2007-5-16 23:59 发表update tab_a set col1=(select col2 from tab_b where tab_b.logno=tab_a.logno and ...)
这个sql没有where子句,当tab_a中有一条logno=1 and nodeno=1的记录,但tab_b中没有时,tab_a中的这条记录的col1字段会被更新为NULL,一般情况下这不是我们想要的结果。
请参见我的问题:
http://bbs.chinaunix.net/viewthread.php?tid=938948&extra=page%3D1
页:
[1]