Hi

In the group by clause mentioned above you need to add even the year part.

i.e select to_char(hiredate,'WW'),count(*) from emp
group by to_char(hiredate,'WW'),to_char(hiredate,'yyyy')

if you group by only week you might get incorrect results.

for ex: if you have to dates 12-JAN-1982 & 12-JAN-1983 it would treat both the dates as week no 4 but in reality they both are different. to avoid this you need to add the year part.

Regards,
Raghav.