Empty strings in sql -
m having 2 tables
1) hr_pay_employee_payslip_history_details
2)hr_pay_employee_payslip_history
table 1 has pay_head_id,payslip_history_id , value columns
table 2 has employee_id,payslip_history_id columns
i map table 1 , table 2 on payslip_history_id retrieve employee_id,pay_head_id,value
the problem is, employees not have pay_head_ids , values
how can retrieve pay_head_ids of employees , values(0.00 incase value not stored) ??
this may vary depending on dialect of sql you're using, you'll need use left outer join, this:
select employee_id, pay_head_id, isnull(value, 0.00) value hr_pay_employee_payslip_history history left outer join hr_pay_employee_payslip_history_details details on history.payslip_history_id = details.payslip_history_id
Comments
Post a Comment