I am making a query to see how much stock gets booked into our warehouse, how do I group together all the duplicates so all the quantities can be as one and the same product isn't showing multiple times? I will post a screenshot to show what I get and the code I'm using. Thanks
select b.qty, a.part, a.desc1, a.main_supplier as supplier_acc_no, c.name as
supplier_name, a.main_mpn, a.date_receipt as date_booked_in
from public.stock as a
inner JOIN public.sthist AS b ON a.part = b.part
inner join public.supplier as c on a.main_supplier = c.account
where a.date_receipt > date_trunc('day', CURRENT_DATE) - INTERVAL '2 days'
and b.tran_type = 'POGRN'
group bywithsum?