
Untitled
By: a guest on
Apr 29th, 2012 | syntax:
None | size: 0.49 KB | hits: 15 | expires: Never
Average of timestamp/Datetime in my query? Please help?
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;
SELECT a.job_name, AVG(endtime)
FROM (...)
WHERE (...)
GROUP BY a.job_name
SELECT
FROM_UNIXTIME(AVG(UNIX_TIMESTAMP(endtime)))
FROM
...
...
...