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: SQL "Group By" question

Re: SQL "Group By" question

From: DanHW <danhw_at_aol.com>
Date: 26 Aug 1998 01:46:35 GMT
Message-ID: <1998082601463600.VAA29023@ladder03.news.aol.com>


> I have a table called XYZ that has a column called date_open (which
>naturally has the date in which the entry was entered into the table).
>
>I would like to create some sort of report/group by sql statement that will
>return : July 10, August 23 In other words, a count will be done on each
>month and will see how many calls were entered into the table. How would
>this be done? I've tried thinking about the between, but couldn;t figure how
>to show each month and its number of calls.
>
>

You need to group by the MONTH, using a TO_CHAR, and the correct date format. Assuming you want to do it correct for each year, you can do something like this:

select to_char(date_open,'Month YYYY'), count(*) from XYZ group by to_char(date_open,'Month YYYY');

Dan Hekimian-Williams Received on Tue Aug 25 1998 - 20:46:35 CDT

Original text of this message

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