seems you need the sum of the table's union
select productId, sum(usedQuantity) usedQuantity
from (
select productId, usedQuantity
from table_one
union all
select productId, usedQuantity
from table_two
union all
select productId, usedQuantity
from table_three ) t
group by productId
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…