RKD Employee Salary Element Wise

Description
Columns: Employee Number, Full Name, Effective Date, Period Name, Basic, Pf Employee, Health Insurance ...
select
ppf.employee_number,
ppf.full_name,
ppa.effective_date,
tp.period_name,
sum(decode(ety.element_name,'REN Basic',to_number(rrv.result_value),0))Basic,
sum(decode(ety.element_name,'REN PF Employee',to_number(rrv.result_value),0))PF_Employee,
sum(decode(ety.element_name,'Health Insurance Premium Upload',to_number(rrv.result_value),0)) Health_insurance
from
per_all_people_f ppf,
per_all_assignments_f paf,
pay_assignment_actions pas ,
pay_payroll_actions ppa,
pay_run_results rr,
pay_run_result_values rrv,
pay_element_types_f ety,
pay_input_values_f i ,
per_time_periods tp
where 1=1 and 
ppf.person_id=paf.person_id and
paf.assignment_id=pas.assignment_id and
pas.assignment_action_id=rr.assignment_action_id and
ppa.payroll_action_id=pas.payroll_action_id and
rr.element_type_id=ety.element_type_id and
i.element_type_id=ety.element_type_id and
rrv.run_result_id=rr.run_result_id and
rrv.input_value_id=i.input_value_id and
tp.time_period_id=ppa.time_period_id and
i.name='Pay Value'
group by  
ppf.full_name,
ppa.time_period_id,
ppa.effective_date,
ppf.employee_number,
ppf.person_id,
tp.period_name
order by ppa.effective_date