K
Keke Lee
I have 2 queries to return below results:
resultABC:[codeABC], [qtyABC]
resultDEF:[codeDEF], [qtyDEF]
And I want to create a new query to show above results in below columns:
resultABC:[codeABC], [qtyABC]
resultDEF:[codeDEF], [qtyDEF]
And I want to create a new query to show above results in below columns:
Code:
, [qtyABC], [qtyDEF]
whereAs [code] is a Union Select query to combine [codeABC] & [codeDEF] and
to take out the duplicates.
I am only able to create a SQL to query their combined results like:
SELECT [codeABC] AS [code], [qtyABC] AS [qty]
FROM [resultABC]
UNION SELECT [codeDEF] AS [code], [qtyDEF] AS [qty]
FROM [resultDEF]
whereas it returns combined value of [code] & [qty].
How can I rewrite the query that I can show the results
([code],[qtyABC],[qtyDEF]) I want?
Thanks
Keke