ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 更牛的Update语句

更牛的Update语句

原创 Linux操作系统 作者:alkz 时间:2011-10-11 22:52:39 0 删除 编辑

Update Ysjxrwb d Set (jxjhh,zydm,zymc,xn,xq,kcdm,kcmc,xf, zxs,kcxz,kclb,khfs,kkxy,kkx,bz1,fzbs,zhxs, jkxs,syxs,qsjsz,zyfx,xqyq,skfsmc,qzxs,skzs,sjxs,mkzh,mkzhdm,zyfxmkdm,zyfxmk,kcsjxs,xtkxs,knsjxs,kwsjxs,sfdxq,ksfs,kwxs,JXHBBJ,bj,sjqsjsz,sjzzs,syqsjsz)= (select a.jxjhh,a.zydm,a.zymc,'2011-2012' xn,'1' xq,a.kcdm,a.kcmc,a.xf, a.zxs,a.kcxz,a.kclb,a.khfs,a.kkxy,a.kkx,a.bz,substr(a.kcnbbh,1,2),a.zhxs, a.jkxs,a.syxs,a.qsjsz,a.zyfx,b.xqbs,a.skfsmc,a.qzxs,a.skzs,a.sjxs,a.mkzh,a.mkzhdm,a.zyfxmkdm,a.zyfxmk,a.kcsjxs,a.xtkxs,a.knsjxs,a.kwsjxs,a.sfdxq,a.ksfs,a.kwxs,a.JXHBBJ,a.bj,a.sjqsjsz,a.sjzzs,a.syqsjsz  from jxjhkcxxb a,jxjhzyxxb b where a.jxjhh=b.jxjhh And b.jxjhh like '2011%'  and (((a.jyxdxq='1' or ','||a.kkkxq||',' like '%,1,%' ) and cqzs is null) or ((a.jyxdxq='2' or ','||a.kkkxq||',' like '%,2,%' ) and cqzs='春')) and  a.Jxjhh||a.Kcdm||a.Zyfx=d.Jxjhh||d.Kcdm||d.Zyfx ) Where d.xn='2011-2012' And d.xq='1'  and  Exists (Select 'x' From Ysjxrwb c  Where c.Jxjhh||c.Kcdm||c.Zyfx=d.Jxjhh||d.Kcdm||d.Zyfx And c.xn='2011-2012' And c.xq='1' And substr(c.jxjhh,1,4)='2011' and  1=1) and  1=1 and (d.bz is null or d.bz<>'计划外课程')

这个语句太庞大,一定要用pl/sql或toad中的格式化语句后,才可以看出来,到底要干嘛

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26273/viewspace-708997/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2009-12-01

  • 博文量
    13
  • 访问量
    28223