Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> 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.
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content=3D"text/html; charset=3Diso-8859-1" =http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3DArial size=3D2> <DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>Try</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>select count(status) from AAA<BR>group =by=20
<DIV> </DIV> <DIV><FONT face=3DArial size=3D2>Ravindran.</FONT></DIV></FONT></DIV> <BLOCKQUOTE=20
<DIV><FONT face=3DArial size=3D2><SPAN =
class=3D798181618-05122000> =20
from AAA</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN =
class=3D798181618-05122000> group=20
by week_of ( </SPAN></FONT></SPAN></FONT><FONT face=3DArial=20
size=3D2><SPAN class=3D798181618-05122000> REGISTRATION_DATE )=20
;</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D798181618-05122000></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D798181618-05122000></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D798181618-05122000>Any =
Received on Wed Dec 06 2000 - 04:25:32 CST
![]() |
![]() |