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

Home -> Community -> Usenet -> c.d.o.server -> Re: count by month

Re: count by month

From: Niall Litchfield <n-litchfield_at_audit-commission.gov.uk>
Date: Fri, 31 Aug 2001 08:49:03 +0100
Message-ID: <3b8f4171$0$225$ed9e5944@reading.news.pipex.net>


Did you even read Darios reply? I suggest you check that where he gives you the solution.

--
Niall Litchfield
Oracle DBA
Audit Commission UK
"Ben" <bthomas_at_trey-industries.com> wrote in message
news:991ee5b0.0108301807.6d0454d5_at_posting.google.com...

> Sorry, I goofed a bit, a better example would be :
>
> > > sale saledate
> > > 12 01/16/2001
> > > 33 02/05/2001
> > > 2 03/15/2001
>
> so I can ask:
>
> select count(*)
> from table1
> where saledate >= (to_date('03-01-2001', 'MM-DD-YYYY')
> and saledate < (to_date('04-01-2001', 'MM-DD-YYYY')
> But I thought "there has to be a better way". I want to group by the
> month of the date field. So I would have the count of all the sales by
> month without having to write 12 queries. Sorry for mis posting the
> first time. I don't see how I can do this without an Oracle
> GRAB_MONTH_FROM_DATE function but I don't know much about SQL as is
> obvious.
> ben
Received on Fri Aug 31 2001 - 02:49:03 CDT

Original text of this message

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