I've acturally got my head around what you're saying.
My questions are, how can I retrieve a list of products or one specific product based on this?
Currently my code has a HAVING clause
Secondly what is the IN(1,2) referencing ?
Lately, why is there no FROM table? Might link to the first question
select productId, sum(qty) qty from (
select productId , sum(quantity) qty from stock WHERE productId IN(1,2) group by productId
union all
select productId, -sum(quantity) qty from order_items WHERE productId IN(1,2) group by productId
) x group by productId