select max(fv.gettime) into thistime from t_d_functionvalue fv
join t_d_function f
on f.buildid||'-'||f.gatewayid||'-'||f.meterid||'-'||f.functionId=fv.functionid
left join t_d_functionsplit fs
on fs.functionid=f.id
where fv.gettime>=to_date(hour_start,'yyyy-mm-dd hh24 mi:ss') and fv.gettime<to_date(hour_end,'yyyy-mm-dd hh24 mi:ss')
and fv.iserror = '0'
and (fv.functiontype=itemId or fs.type=itemId)
and fun_getbuildidbyuniqueid(fv.functionId)=buildId
and fun_getgatewayidbyuniqueid(fv.functionId)=gatewayId;
return to_char(thistime,'yyyy-mm-dd hh24 mi:ss'); 请问下各位oracle高手 为什么在Function函数中return回来的thistime与实际的时间不对呢 我测试了一下 在2010-08-05 10 00:00 到2010-08-05 11 00:00 这段区间 rerun回来的时间是2010-08-05 11 53:52
select max(fv.gettime) from t_d_functionvalue fv
join t_d_function f
on f.buildid||'-'||f.gatewayid||'-'||f.meterid||'-'||f.functionId=fv.functionid
left join t_d_functionsplit fs
on fs.functionid=f.id
where fv.gettime>=to_date('20100805110000','yyyy-mm-dd hh24 mi:ss') and fv.gettime<to_date('20100805120000','yyyy-mm-dd hh24 mi:ss')
and fv.iserror = '0'
and (fv.functiontype='01A10' or fs.type='01A10')
and fun_getbuildidbyuniqueid(fv.functionId)='320102A002'
and fun_getgatewayidbyuniqueid(fv.functionId)='6'; 而我把这段SQL代码复制到普通的测试窗口 把相应的参数带入里面 返回的真实的最大时间是2010-08-05 11:03:26请高手帮我解释下
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货