|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: Richard Reina (gatorreina
gmail.com)
Date: Fri Apr 19 2013 - 09:44:44 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Perfect! Thank you Larry et all.
Have a great weekend.
2013/4/19 Larry Martell <larry.martell
gmail.com>
> On Fri, Apr 19, 2013 at 8:24 AM, Richard Reina <gatorreina
gmail.com>
> wrote:
> > Hello All,
> >
> > Happy Friday! I know how to do the following query:
> >
> >>select count(*) from sales where WEEK(sale_date)=15 AND
> > YEAR(sale_date)=2013;
> >
> > But can someone tell me I can do a query that will give me:
> >
> > the count(*) for each week of 2013 so that I end up with:
> >
> > WEEK | COUNT
> > 1 | 22
> > 2 | 31
> > 3 | 29
> > etc...
>
> select WEEK(sale_date), count(*) from sales where YEAR(sale_date)=2013
> group by WEEK(sale_date);
>
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]