Вы хотите full join
и накопленную сумму. Я думаю, что логика:
select coalesce(i.date, o.date) as date,
coalesce(i.product, o.product) as product,
coalesce(i.qty, 0) as received,
coalesce(o.qty, 0) as qty_out,
(sum(coalesce(i.qty, 0)) over (partition by i.product order by i.date) -
sum(coalesce(o.qty, 0)) over (partition by o.product order by i.date)
) as on_hand
from intable i full join
outtable o
on i.date = o.date and i.product = o.product