Re: Oracle Query Help

From: Jeffrey Ellin <deaduser_at_hotmail.com>
Date: 20 Jun 2001 06:45:31 -0700
Message-ID: <e8a45386.0106200545.22c41016_at_posting.google.com>


c.und.h_at_t-online.de (Hans Wiezorke) wrote in message news:<861fd37d.0106192340.4ec92af4_at_posting.google.com>...
> deaduser_at_hotmail.com (Jeffrey Ellin) wrote in message news:<e8a45386.0106191721.2d2c3e0e_at_posting.google.com>...
>
> > select personid,
> > decode(product,A,quantity,0) as producta,
> > decode(product,b,quantity,0) as productb,
> > decode(product,c,quantity,0) as productc
> > from person
>
> try the following:
>
> select
> personid,
> sum(decode(product,A,quantity,0)) as producta,
> sum(decode(product,b,quantity,0)) as productb,
> sum(decode(product,c,quantity,0)) as productc
> from person
> group by personid
>
> Have fun,
> Hans

This gives me a total for all weeks. I need it broken up by weeks.

Jeff Received on Wed Jun 20 2001 - 15:45:31 CEST

Original text of this message