Results 1 to 3 of 3
  1. #1
    Join Date
    May 2006

    Unanswered: [Oracle 10g] Timestamps (sum)

    hello all together, I habe following problem and I hope you can help me.
    I have 1 table with 2 TIMESTAMPS, start and stop.

    now I want the time summarized over one day.
    actual my select stmt looks like

    select (STOPTIME - STARTTIME) from TIMES where extract(day from STARTTIME) = extract(day from SYSTIMESTAMP);
    this already works fine, but how can I summarize the values sum doesn't work for me.

    thanks and greets

  2. #2
    Join Date
    Jan 2004
    Croatia, Europe
    Provided Answers: 5
    Check this page; you'll find an example of "extracting" secs/mins/hours... that elapsed between two timestamps. It doesn't look very elegant, but perhaps you'll be able to use it as an idea for your problem.

  3. #3
    Join Date
    Sep 2004
    London, UK
    For some reason Oracle haven't quite got around to overloading SUM and AVG for interval types yet. (Presumably they are too busy working on 10g for Intel Mac.) In the meantime you have to roll your own.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts