Hey ,
I'm using cross tabulation in which i have two regions TPSPakistan and TPSME . But it is showing TPSPakistan twice. Why?
here is the code:
DROP PROCEDURE IF EXISTS sp_DBR_Project_regionwise
$$
CREATE PROCEDURE sp_DBR_Project_regionwise
()
begin
select 'dbr.crosstab', 2;
SELECT Level,c.Office_Division as region,sum(duration/60) as 'Duration'
FROM timesheets.tps_trans_effort_timeline t,wf_workflow.users u,
wf_workflow.tps_lut_customusers c
where
t.usr_uid=u.usr_uid
and u.usr_username=c.Employee_Domain_ID
group by 1,2;
end
$$
And the output is :
region
TPSPakistan TPSME TPSPakistan
Level Duration Duration Duration
Level - 1 10122.97
Level - 10 129.20
Level - 2 27727.45
Level - 3 32601.73
Level - 4 62057.90 4.35
Level - 5 289.75 3932.05
Level - 6 4838.98
Level - 7 269.00
I want it like this :
region
TPSPakistan TPSME
Level Duration Duration
Level - 1 10122.97
Level - 10 129.20
Level - 2 27727.45
Level - 3 32601.73
Level - 4 62057.90 4.35
Level - 5 3932.05 289.75
Level - 6 4838.98
Level - 7 269.00
What I m doing wrong here? Please help.
Regards,
Bushra