标签:style blog http ar os sp strong on 文件
作者:iamlaosong
一条SQL查询语句报错,与语句无关,与条件中的值无关,错误是ORA-03113,语句如下:
select * from tb_evt_dlv a, tb_jg b,tb_evt_mail_clct c where a.mail_num=c.mail_num and a.dlv_date between to_date('2014-11-1','yyyy-mm-dd') and to_date('2014-11-1','yyyy-mm-dd') and a.dlv_sts_code='I' and a.dlv_bureau_org_code =b.zj_code and a.dlv_bureau_org_code like '23009201%' order by b.city,b.ssxs,b.zj_code,a.dlv_date
错误如下图一,关闭图一,出现图二:
这个错误肯定与通信没有关系,这个错误以前也碰到过,当时条件是“23007300”,这个机构依然报错,不过只在关联sncn_zd_jg这个表时报错,现在又发现“23009201”也报错,比那个还严重,更换机构表tb_jg和sncn_zd_jg都报错(参见:一个奇怪的查询语句(不知原因)),很是奇怪。
将‘23009201%’改成‘230092%’,或者直接将like ‘23009201%’换成=‘23009201’都可以成功执行。如下:
select * from tb_evt_dlv a, tb_jg b,tb_evt_mail_clct c where a.mail_num=c.mail_num and a.dlv_date between to_date('2014-12-10','yyyy-mm-dd') and to_date('2014-12-10','yyyy-mm-dd') and a.dlv_sts_code='I' and a.dlv_bureau_org_code =b.zj_code and a.dlv_bureau_org_code = '23009201' order by b.city,b.ssxs,b.zj_code,a.dlv_date
去掉最后一个表,改成下面的语句也可以成功执行。如下:
select * from tb_evt_dlv a, tb_jg b where a.dlv_date between to_date('2014-12-10','yyyy-mm-dd') and to_date('2014-12-10','yyyy-mm-dd') and a.dlv_sts_code='I' and a.dlv_bureau_org_code =b.zj_code and a.dlv_bureau_org_code like '23009201%' order by b.city,b.ssxs,b.zj_code,a.dlv_date
不知原因何在?
标签:style blog http ar os sp strong on 文件
原文地址:http://blog.csdn.net/iamlaosong/article/details/41864283