Re: Complicated Query
Date: Sat, 13 Sep 2008 08:14:07 +0200
<artmerar_at_yahoo.com> a écrit dans le message de news: a3c73b2a-81fb-48bb-bd25-f96d8825fa70_at_m36g2000hse.googlegroups.com...
| I'm trying to write a complicted query, maybe someone can help. Here
| is the table:
| 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.
| 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.
Michel Received on Sat Sep 13 2008 - 01:14:07 CDT