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: Ben <bthomas_at_trey-industries.com>
Date: 30 Aug 2001 19:07:11 -0700
Message-ID: <991ee5b0.0108301807.6d0454d5@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 Thu Aug 30 2001 - 21:07:11 CDT

Original text of this message

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