Message-Id: <10702.123768@fatcity.com> From: ravi@oil.asm.nic.in (T. Ravindran) Date: Wed, 6 Dec 2000 15:55:32 +0530 Subject: Re: group by week This is a multi-part message in MIME format. ------=_NextPart_000_0038_01C05F9C.F6DD2980 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, Try select count(status) from AAA group by to_char(reg_date,'IW'); Ravindran. ----- Original Message -----=20 From: andrey=20 To: Multiple recipients of list ORACLE-L=20 Sent: Tuesday, December 05, 2000 11:50 PM Subject: group by week Dear list ! =20 I have a table AAA with fields (registration_date , status ) . I need a report which will group the results by week . =20 I.e instead of=20 select to_date(to_char(REGISTRATION_DATE,'DD-MON-YYYY')), = count(status)=20 from AAA group by to_date(to_char(REGISTRATION_DATE,'DD-MON-YYYY')); =20 =20 I need something like=20 select first_date_in_the_week(REGISTRATION_DATE) , count(status)=20 from AAA group by week_of ( REGISTRATION_DATE ) ; =20 =20 Any ideas ? ------=_NextPart_000_0038_01C05F9C.F6DD2980 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,
 
Try
 
select count(status) from AAA
group = by=20 to_char(reg_date,'IW');
 
Ravindran.
----- Original Message -----
From:=20 andrey=20
To: Multiple recipients of list ORACLE-L =
Sent: Tuesday, December 05, = 2000 11:50=20 PM
Subject: group by week

Dear = list=20 !
 
I = have a table AAA=20 with fields (registration_date , status ) .
I = need a report=20 which will group the results by week .
 
I.e = instead of=20
   =20 select to_date(to_char(REGISTRATION_DATE,'DD-MON-YYYY')), = count(status)=20
   =20 from AAA
   group=20 by = to_date(to_char(REGISTRATION_DATE,'DD-MON-YYYY'));
 
 
I = need something=20 like
 =20 select  first_date_in_the_week(REGISTRATION_DATE) , count(status) =
   =20 from AAA
   group=20 by week_of (   REGISTRATION_DATE )=20 ;
 
 
Any =