这是我的以下sql查询。查询中时间戳/日期时间的平均值?请帮忙?
select a.job_name,endtime,to_char(endtime,'HH24:MI:SS') as endtime_1
from OPTOOLS.R11_JOB_PROD_VW a, OPTOOLS.R11_JOB_RUNS_PROD_VW b
where
a.joid=b.joid and a.job_name in ('hh_p_hkc_isrs_gim_trd_ld_bx') and rownum <= 30
and status = 'SUCCESS'
order by endtime desc;
请帮我找到上述query.I的结束时间平均需要这个urgently.Anybody谁是SQL好,可以请你修改我的查询&帖吧。
我发现平均时间戳很难处理。
你的问题被标记'mysql',但'to_char'看起来相当Oraclish给我。 – 2012-02-16 07:41:47