Můžete provést dílčí dotaz na každou tabulku, abyste získali součet množství pro každého zákazníka, a poté připojit výsledky podle zákazníka ide.g
SELECT a.*, b.*
FROM (
Select customer_id, product, dateofsale, PayMeth1, PayMeth2, SUM(Qty) as Qty
from TableA
Group by customer_id, product, dateofsale, PayMeth1, PayMeth2
) a
JOIN (
Select customer_id, product, dateofsale, PayMeth1, PayMeth2, SUM(Qty) as Qty
from TableB
Group by customer_id, product, dateofsale, PayMeth1, PayMeth2
) b
ON a.customer_id = b.customer_id