How to sum two differents columns into a same SQL query

I need to do a SQL query summing two differents columns into a same query; I uploaded under attached files the steps that I followed, the error messages, and the result that I need to get

I appreciate your kindly support

Roberto

Message was edited by: Roberto.mx

Message was edited by: Roberto.mx

Query summing two columns.docx (26.4 KB)

Try adding a GROUP BY clause.

select
we.wip_entity_id,
we.wip_entity_name,
si.segment1||’.’||segment2 Item,
si.description,
sum(pb.PL_MATERIAL_IN+pb.PL_MATERIAL_OVERHEAD_IN) Material,
pb.PL_MATERIAL_IN,
pb.PL_MATERIAL_OUT,
pb.PL_MATERIAL_VAR
from
wip_period_balances pb,
wip_entities we,
wip_discrete_jobs dj,
mtl_system_items si
where
(
pb.wip_entity_id = we.wip_entity_id
and we.wip_entity_id = dj.wip_entity_id
and we.primary_item_id = si.inventory_item_id
)
and
(
si.organization_id = 83
and dj.date_closed between ‘01-MAY-2013’ and ‘07-May-2013’
and we.wip_entity_name = ‘580947’
)
group by
we.wip_entity_id,
we.wip_entity_name,
si.segment1||’.’||segment2,
si.description,
pb.PL_MATERIAL_IN,
pb.PL_MATERIAL_OUT,
pb.PL_MATERIAL_VAR