Re: Complicated Query

From: Michel Cadot <micadot{at}altern{dot}org>
Date: Sat, 13 Sep 2008 08:14:07 +0200
Message-ID: <48cb5a31$0$3468$426a34cc@news.free.fr>

<artmerar_at_yahoo.com> a écrit dans le message de news: a3c73b2a-81fb-48bb-bd25-f96d8825fa70_at_m36g2000hse.googlegroups.com...
|
| Hi,
|
| I'm trying to write a complicted query, maybe someone can help. Here
| is the table:
|
| ACTION
| DATE
| PRODUCT
|
| The ACTION column contains 2 values (A, D). What I want to do is to
| get a count, by PRODUCT for each ACTION type for each MONTH range.
|
| So, a count for product 1 with an action of A for 8/1/08 - 8/31/08.
| Then, a count for product 1 with an action of D for 8/1/08 - 8/31/08.
|
| So, a count for product 2 with an action of A for 8/1/08 - 8/31/08.
| Then, a count for product 2 with an action of D for 8/1/08 - 8/31/08.
|
| Etc.....
|
| I think this can be done with an analytical function of some sorts,
| rather than writing some PL/SQL code. I'm searching, but maybe
| someone else can help......
|
| Thank you much!

count(*) group by product, action, trunc(date,'month') No need to analytics there, good old aggregate.

Regards
Michel Received on Sat Sep 13 2008 - 01:14:07 CDT

Original text of this message