I have a table(EMP_Comm_Calc) as shown below:
Min-Wage Max-Wage Comm% Work_Type_ID Working_Days Max_Allowed Min_Allowed
400 2000 30 2426 20 2000 1888
450 2000 30 2426 30 2000 1888
1680 2000 54 2426 20 2000 1888
1680 2000 54 2426 30 2000 1888
1900 2000 65 2426 20 2000 1888
1950 2000 65 2426 30 2000 1888
450 2500 30 2427 20 2500 1999
450 2500 30 2427 30 2500 1999
2100 2500 54 2427 20 2500 1999
2100 2500 54 2427 30 2500 1999
2380 2500 65 2427 20 2500 1999
2380 2500 65 2427 30 2500 1999
Now I want to transpose the rows based on Comm% and Working_days for each Work_type_id, the expected output is:
Work_Type_ID Min2065 Max2065 Min2030 Max2030 Min2054 Max2054 Min3065 Max3065 Min3030 Max3030 Min3054 Max3054 Max_allowed Min_Allowed
2426 1900 2000 400 2000 1680 2000 1950 2000 450 2000 1680 2000 2000 1888
2427 2380 2500 450 2500 2100 2500 2380 2500 450 2500 2100 2500 2500 1999