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

Home -> Community -> Usenet -> c.d.o.server -> Re: SQLPLUS QUESTION

Re: SQLPLUS QUESTION

From: Doogie <jvivona_at_mindspring.com>
Date: 1997/12/10
Message-ID: <348F4930.28A2@mindspring.com>#1/1

Bill,

	What's wronf with the code you have ???
        The only thing I can think of is the format of the date/time
        use the to_char function in the select and the group by
        to select a specific value & group by that same value.

WILLIAM LUCOFF wrote:
>
> This is a really dumb ( I am having a mental block as I am writting
> this code as an SQL*PLUS script).
> here is the question:
>
> I have a table
> tbl_x
> col1 col2 date_col
> 1 450 01/12/97:0100
> 2 50 01/12/97:0100
> 3 5 01/12/97:0100
> 1 199 01/12/97:0200
> 2 100 01/12/97:0200
> 3 5 01/12/97:0200
> . . .
> . . .
> . . .
>
> I nead to do a rollup the totals based on time
>
> Namely ( Phesudo code)
>
> select sum(col2),date_col from tbl_x group by date_col
>
> with the output looking like
>
> Sum(col2) Date_col
> 505 01/12/97:0100
> 304 01/12/97:0200
> . .
> . .
>
> any thoughts on how I can accomplish this
>
> thanks:
>
> -- Bill Lucoff
Received on Wed Dec 10 1997 - 00:00:00 CST

Original text of this message

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