declare begin for tttt in (select temp.c_id from (select cst.c_tci_id, max(ins.T_END_DATE) as endDate from tb_test_1 t1, tb_test_2 t2 where t1.c_id = t2.c_id and t1.C_DEL = '0' group by c_tci_id) temp where endDate < sysdate) loop update tb_test_1 t1 set t1.c_stat ='0' where t1.c_id = tttt.c_id; --commit; end loop; end;--declare begin for thecst in (select temp.c_tci_id from (select cst.c_tci_id, max(ins.T_END_DATE) as insDate from tb_test1 cst, tb_test2 ins where cst.c_tci_id = ins.c_cst_id and cst.C_DEL = '0' --and cst.c_stat = '0' and cst.C_NO_RELEASE = '1' and ins.C_DEL = '0' and ins.c_stat is null and ins.c_is_telesale_ply is null group by c_tci_id) temp where insDate < sysdate and temp.c_tci_id not in (select cst.c_tci_id from tb_cst_info cst, tb_ins_info ins where cst.c_tci_id = ins.c_cst_id ) ) loop update tb_test1 cst set cst.C_NO_RELEASE = '0',cst.T_NO_RELEASE_TIME = sysdate, cst.c_stat ='0' where cst.c_tci_id = thecst.c_tci_id; --commit; end loop; end;
详细解决方案
sql 存储过程 for in loop 施用 业务
热度:694 发布时间:2016-05-05 13:45:59.0
相关解决方案
- vfp6.0 do while 循环 loop 如何一下退出了就
- 有人知道while loop 和 do-while loop的区别么?
- 为什么出现break outside switch or loop?
- 出现break outside switch or loop
- [求助] loop 语句怎样用啊?请指点
- html <loop name="list_destination"> 啥意思解决思路
- Why won't my HTML5 audio loop
- {dede:loop}的有关问题
- 不要忽略任何一个异常提示,更要找到原因linked websocket controlling loop crashed with reason: kille
- Extjs4-退出store.each() unlabelled break must be inside loop or switch
- while loop, checking 問題,该如何处理
- eclipse 错误Unhandled event loop exception 源头解决方法
- myeclipse点击部署旋钮时候 Unhandled event loop exception,
- 关于eclipse的 Unhandled event loop exception PermGen space 有关问题
- Eclipse发生错误Unhandled event loop exception No more handles
- Eclipse编辑java文件报Unhandled event loop exception异常的解决方法
- Eclipse中按crtl键卡死后报Unhandled event loop exception Java heap space解决办法
- Eclipse 出现”unhandled event loop exception permgen space“异常
- Eclipse CDT 解决 "for loop initial declaration used outside C99 mode" 异常
- LOOP 中出现错误后如何继续执行循环,执行下一条记录
- 为什么Looper.loop()循环不会阻塞主线程?
- PHPCMS V9{loop subcat(0,0,0,$siteid) $r}如何解释
- {dede:loop}的有关问题
- CUDA - Branch Divergence and Unrolling Loop
- loop 的纳闷
- sql 存储过程 for in loop 施用 业务
- 小技能 SQL execution loop
- Oracle/PLSQL: FOR Loop 循环话语
- js执行顺序之Even Loop
- ue4 loop 中执行delay无效的原因和解决方法(遇到了做个笔记,我开始搜解决方法,还要VIP坑)