I have this query .This query have union all
select cm.comp_name,e.Name_Employee,SUM(im.MSalary) MSalary,ID_invoice
from MMas im , employee e , company cm
where
e.ID_Employee = im.ID_Employee
and im.cid = cm.cid
and im.ID_Employee=74
group by cm.comp_name,e.Name_Employee , ID_invoice
union all
select cm.comp_name, e.Name_Employee,SUM(id.Amount) FBenefits,ID_invoice
from MMas im, MDil id,employee e, company cm
where
im.MInd =id.MInd
and e.ID_Employee=im.ID_Employee
and cm.cid=im.cid
and im.ID_Employee=74
group by cm.comp_name,e.Name_Employee ,ID_invoice
and this shows result like this
comp_name Name_Employee ID_Employee MSalary ID_invoice
ABC_Company David 74 1000 98950
ABC_Company David 74 0 98950
where as i want result like this
comp_name Name_Employee ID_Employee MSalary F_Benefits ID_invoice
ABC_Company David 74 1000 0 98950
how to do this ?