Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 29th, 2012  |  syntax: None  |  size: 0.49 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Average of timestamp/Datetime in my query? Please help?
  2. select a.job_name,endtime,to_char(endtime,'HH24:MI:SS') as endtime_1
  3.    from OPTOOLS.R11_JOB_PROD_VW a, OPTOOLS.R11_JOB_RUNS_PROD_VW b
  4.    where
  5.    a.joid=b.joid and a.job_name in ('hh_p_hkc_isrs_gim_trd_ld_bx') and rownum <= 30
  6.    and status = 'SUCCESS'
  7.    order by endtime desc;
  8.        
  9. SELECT a.job_name, AVG(endtime)
  10. FROM (...)
  11. WHERE (...)
  12. GROUP BY a.job_name
  13.        
  14. SELECT
  15.   FROM_UNIXTIME(AVG(UNIX_TIMESTAMP(endtime)))
  16. FROM
  17.   ...
  18.   ...
  19.   ...