Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Help: SQL Question

Help: SQL Question

From: Arthur Wei <arthur_wei_at_263.net>
Date: Mon, 21 Jan 2002 14:48:48 +0800
Message-ID: <a2gdpe$2rk8$1@news.cz.js.cn>


I have a table like this:

    create table t (

        time    date    not null,
        count   number  not null

    )

Data in this table like this: ( time is in format 'YYYY-MM-DD HH24:MI' )

    time                count
    ---------------------------------
    2002-1-1 0:0        100
    2002-1-1 0:1        45
    2002-1-1 0:3        20
    2002-1-1 0:5        742
    2002-1-1 0:6        235
    2002-1-1 0:10       124
    2002-1-1 0:11       23
    2002-1-1 0:12       23
    2002-1-1 0:18       577
    2002-1-1 0:21       124
    2002-1-1 0:22       23
    2002-1-1 0:25       23
    2002-1-1 0:31       577

    ......

I want to calculate the sum(count) of every 15 minutes, for example:

    summary of      2002-1-1 0:0        100
                    2002-1-1 0:1        45
                    2002-1-1 0:3        20
                    2002-1-1 0:5        742
                    2002-1-1 0:6        235
                    2002-1-1 0:10       124
                    2002-1-1 0:11       23
                    2002-1-1 0:12       23

    summary of      2002-1-1 0:18       577
                    2002-1-1 0:21       124
                    2002-1-1 0:22       23
                    2002-1-1 0:25       23

    summary of      2002-1-1 0:31       577
                    ......

What should I do? Is there anyone who can provide a solution? Thank you.

Arthur Wei
Beijing, China
14:48 Jan 21, 2002 Beijing Time Received on Mon Jan 21 2002 - 00:48:48 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US