Oracle中日期转换报"输入值对于日期格式长度不够"
select (select j.jgmc from t_zzjg j where j.jgdm = t.jgdm) jgmc,
t.jgdm,
sum(t.jcj) jcj,
sum(t.sa) sa,
sum(t.la) la,
sum(t.ajbl) ajbl,
sum(t.xsqzcs) xsqzcs,
sum(t.sacw) sacw,
sum(t.jgzx) jgzx,
sum(t.zfgz) zfgz,
sum(t.jjclaj) jjclaj,
sum(t.zs) zs
from t_fxyp_zfycfbtj t
where t.rq between to_date(2013 - 01 - 18 , 'YYYY-MM-DD') and
to_date(2013 - 07 - 18 , 'YYYY-MM-DD')
and exists (select z.jgdm
from t_zzjg z
where (z.dwlx = 'SJ' or z.sjjgdm is null)
and z.jgdm = t.jgdm)
group by t.jgdm
order by t.jgdm
正确语句
select to_date('2012-05-06 12:05:03','yyyy-mm-dd hh24:mi:ss') from dual
select to_date('2012-05-06','yyyy-mm-dd hh24:mi:ss') from dual
select to_date('2012-05-06','yyyy-mm-dd') from dual
该查询语句导致该原因是因为在to_date()这个方法里面,前面输入的日期要加上单引号.