P
pol
Please can help me anybody for the following..
select
attdate
max(emp.mon_hrs) as mon_hrs ,
max(emp.tue_hrs) as tue_hrs ,
max(emp.wed_hrs) as wed_hrs ,
max(emp.thu_hrs) as thu_hrs,
max(emp.fri_hrs) as fri_hrs ,
max(emp.sat_hrs) as sat_hrs
from emp
group by attdate ;
How I can rewrite this as follows
Select
attdate
if(dayname(attdate)) = 'Monday' , max(emp.mon_hrs),if(dayname(attdate)) =
'Tuesday', max(emp.tue_hrs)
from emp
group by attdate ;
With thanks
Polachan
select
attdate
max(emp.mon_hrs) as mon_hrs ,
max(emp.tue_hrs) as tue_hrs ,
max(emp.wed_hrs) as wed_hrs ,
max(emp.thu_hrs) as thu_hrs,
max(emp.fri_hrs) as fri_hrs ,
max(emp.sat_hrs) as sat_hrs
from emp
group by attdate ;
How I can rewrite this as follows
Select
attdate
if(dayname(attdate)) = 'Monday' , max(emp.mon_hrs),if(dayname(attdate)) =
'Tuesday', max(emp.tue_hrs)
from emp
group by attdate ;
With thanks
Polachan