
会加锁
这个一般这样写的
begin
select NVL(id,-1) into v_id from student where id = 3 for updateexception when no_data_found then
v_id =-1
end
就是用异常去写,以前刚学的时候也跟楼主一样写法,不行的哈。没得到数据跟得到的是NULL不是一回事。
update 用法是:update table a, table (select distinct * from (select K_KPBH as K_KPBH,max(K_BGXH) as K_BGXH from ZC_KPXXB where K_KPBH in (select www from lp234) group by K_KPBH) a left outer join ZC_KPXXB b on a.K_KPBH=b.K_KPBH and a.K_BGXH=b.K_BGXH) b set a.XX = b.XX where a.YY = b.YY
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)