错了,上面的帖子里面的update语句应该为:
update t1 x
set x.clst3 = (
select y.clst2 from t2 y
where x.clst1 = y.clst1
)
where x.clst1 in (select clst1 from t2);
update t1 x
set x.clst3 = (
select y.clst2 from t2 y
where x.clst1 = y.clst1
)
where x.clst1 in (select clst1 from t2);
只能用procedure嘛?
set x.clst3 = (
select y.clst2 from t2 y
where x.clst2 = y.clst2 and rownum = 1
)
where x.clst1 in (select clst1 from t2);如果符合条件的为多条记录,你说选择那条呢?这些记录都是一样的值的话,就可以这么做