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
相关解决方案
- html <loop name="list_destination"> 啥意思解决思路
- {dede:loop}的有关问题
- 不要忽略任何一个异常提示,更要找到原因linked websocket controlling loop crashed with reason: kille
- Extjs4-退出store.each() unlabelled break must be inside loop or switch
- eclipse 错误Unhandled event loop exception 源头解决方法
- myeclipse点击部署旋钮时候 Unhandled event loop exception,
- 关于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}的有关问题
- loop 的纳闷
- sql 存储过程 for in loop 施用 业务
- 小技能 SQL execution loop
- js执行顺序之Even Loop
- // Event Loop/事件循环/事件环(5)
- error: 'for' loop initial declaration used outside C99 mode的解决方法
- iOS多线程开发(三)--Run Loop(二,三)
- iOS多线程开发(三)--Run Loop(一)
- LOOP AT GROUP BY语法练习
- javascript基础-微任务、宏任务、event loop
- Too many re-renders. React limits the number of renderers to prevent an infinite loop...
- 'for' loop initial declarations are only allowed in C99 mode
- Eclipse CDT 解决 for loop initial declaration used outside C99 mode 异常
- arduino项目名与项目下的文件名重复会导致报错 undefined reference to `setup' |`loop'问题
- shell编程中for循环中遇到“Syntax error: Bad for loop variable”问题以及解决的办法
- python学习——基础——while循环、死循环while True(dead loop)、pass、continue、break、while...else...
- {LOOP | MERGE | HASH } JOIN
- 帝国CMS灵动标签e:loop