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

Home -> Community -> Usenet -> c.d.o.misc -> Re: group by month ?

Re: group by month ?

From: Michel Cadot <micadot_at_netcourrier.com>
Date: Wed, 27 Oct 1999 09:17:20 +0200
Message-ID: <7v690a$q1t$1@oceanite.cybercable.fr>


select to_char(date_col, 'YYYY Mon'), count(*) from <table>
group by trunc(date_col, 'MONTH');

--
Have a nice day
Michel

<javanewbie_at_my-deja.com> a écrit dans le message : 7v5p32$3bq$1_at_nnrp1.deja.com...
> i have a field that stores the date /time .
>
> how do i group the resultset by month ?
>
> meaning, it shows :-
>
> 1999 Jul count1
> Aug count2
> Sep
> Oct
>
>
> i heard that i need to use to_char(date) to convert the
> date/time to a char .
>
> then, i need to count the no of occurances of jan 1999, feb 1999, march
> 1999 and so on.
>
> Any idea how this could be done ?
>
> Thanks a lot.
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Wed Oct 27 1999 - 02:17:20 CDT

Original text of this message

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