Hi ,
I have a doubt in SQL . Suppose i have 2 tables
table 1 : employee_id
time
effort_date
week_ending
table 2 : employee_id
authorization
week_ending
and i have a query that runs like this :
select
emp_id , sum(time), effort_date , authorization
from
table1 a , table2 b
where
a.employee_id = b.employee_id and
a.week_ending = b.week_ending and
a.employee_id = '007' and
a.effort_date between
to_date('01/09/2001','dd/mm/yyyy') and
to_date('30/09/2001','dd/mm/yyyy')
group by
emp_id , effort_date , authorization ;
this returns the following data :
007 9 24/09/2001 30/09/2001
007 14 27/09/2001 30/09/2001
but i want the data in this fashion for the month of september
007 0 01/09/2001 02/09/2001
007 0 02/09/2001 09/09/2001
007 0 03/09/2001 09/09/2001
007 0 04/09/2001 09/09/2001
007 0 05/09/2001 09/09/2001
007 0 06/09/2001 09/09/2001
007 0 07/09/2001 09/09/2001
007 0 08/09/2001 09/09/2001
.
.
.
.
.
007 0 23/09/2001 30/09/2001
007 9 24/09/2001 30/09/2001
.
.
.
007 14 27/09/2001 30/09/2001
.
.
.
007 0 30/09/2001 30/09/2001
how do i achieve this ? There is no problem with the week endings , as my table 2 has all the weekendings in a year.
Thanks in advance !
Regards,
S. Jayaram Uparna .
If the need arises,you are welcome to mail me at oracguru@yahoo.com .
I have a doubt in SQL . Suppose i have 2 tables
table 1 : employee_id
time
effort_date
week_ending
table 2 : employee_id
authorization
week_ending
and i have a query that runs like this :
select
emp_id , sum(time), effort_date , authorization
from
table1 a , table2 b
where
a.employee_id = b.employee_id and
a.week_ending = b.week_ending and
a.employee_id = '007' and
a.effort_date between
to_date('01/09/2001','dd/mm/yyyy') and
to_date('30/09/2001','dd/mm/yyyy')
group by
emp_id , effort_date , authorization ;
this returns the following data :
007 9 24/09/2001 30/09/2001
007 14 27/09/2001 30/09/2001
but i want the data in this fashion for the month of september
007 0 01/09/2001 02/09/2001
007 0 02/09/2001 09/09/2001
007 0 03/09/2001 09/09/2001
007 0 04/09/2001 09/09/2001
007 0 05/09/2001 09/09/2001
007 0 06/09/2001 09/09/2001
007 0 07/09/2001 09/09/2001
007 0 08/09/2001 09/09/2001
.
.
.
.
.
007 0 23/09/2001 30/09/2001
007 9 24/09/2001 30/09/2001
.
.
.
007 14 27/09/2001 30/09/2001
.
.
.
007 0 30/09/2001 30/09/2001
how do i achieve this ? There is no problem with the week endings , as my table 2 has all the weekendings in a year.
Thanks in advance !
Regards,
S. Jayaram Uparna .
If the need arises,you are welcome to mail me at oracguru@yahoo.com .