BIP – Extract Salary basis with associated element details
SELECT csb.name
,csb.salary_basis_code
,csb.salary_annualization_factor
,pld.name LDG
,petft.element_name
,pivt.name input_value_name
,rate.name rate_name
FROM cmp_salary_bases csb,
per_legislative_data_groups_tl pld,
pay_element_types_tl petft,
pay_input_values_f pivf,
pay_input_values_tl pivt,
per_rates_f_tl rate
WHERE 1=1
and csb.legislative_data_group_id = pld.legislative_data_group_id
and pld.language = USERENV('LANG')
and csb.element_type_id = petft.element_type_id
-- and trunc(sysdate) between petft.effective_start_date and petft.effective_end_date
and petft.language = USERENV('LANG')
and csb.element_type_id = pivf.element_type_id
and csb.input_value_id = pivf.input_value_id
and trunc(sysdate) between pivf.effective_start_date and pivf.effective_end_date
and pivf.input_value_id = pivt.input_value_id
and pivt.language = USERENV('LANG')
and csb.grade_rate_id = rate.rate_id(+)
and NVL(rate.language,USERENV('LANG')) = USERENV('LANG')
ORDER BY 1