New answers tagged union
To fix the error: You exposed Qty AS GRNQty; use the latter outside. If there is a question about Q1, I missed it. I recommend using some extra parens when doing UNION: ( SELECT ... ) UNION ALL ( SELECT ... ) Without these parens, you might add a clause (eg LIMIT) and have it mysteriously apply to the second SELECT instead of the UNION.
Top 50 recent answers are included