Hi - this is my first post - so be gentle!
I have two tables - one which holds Order No, Order Line, M/O No and two which holds details relating to the M/O
One Sales Order / Order line links to two M/Os (a network order - upper level, lower level)
I am seeking to retrieve information from both M/Os relating to the same Sales order / line (the consumed material from M/O 1 and the produced quantity from M/O 2
I have written the following SQL
select aybmnb, aywdnb, aya4nb, (select sum(rebaqt) from sms452bfel.z2oorext where rea4nb = aya4nb and reacti = 'OUT' and rea9dt = 20121121) as consumed, (select sum(rebqqt) from sms452bfel.z2oorext where rea4nb = aya4nb and rebatc<>'' and reaqnb = 25) as packed
where aybmnb = 36424
group by aybmnb, aywdnb, aya4nb
and this produces the information below - how can I consolidate this to show on one line (without the M/O)?
Sales Order | Line | M/O| Consumed|Produced