Re: Help Wanted: How to write a single select clause for mutiple counts

From: Tony Damon <bfntd_at_aimnet.com>
Date: 1996/04/01
Message-ID: <4jpm5g$d4p_at_news.aimnet.com>#1/1


Hong Jiang (jiang_at_ccs.neu.edu) wrote: [snip]

:
: But It isn't What I want.
:
: Can I write a single select clause to get the result in one row.
: The result should looks like
:
: OCT NOV SEP
: 2 3 1
:

select sum(decode(to_char(register_date,'MM'),'01',1,0)) JAN,
       sum(decode(to_char(register_date,'MM'),'02',1,0)) FEB,
       sum(decode(to_char(register_date,'MM'),'03',1,0)) MAR,
...

...
..etc

       sum(decode(to_char(register_date,'MM'),'13',1,0)) DEC, from table;

Tony Damon Received on Mon Apr 01 1996 - 00:00:00 CEST

Original text of this message