Microsoft
Software
Hardware
Network
Question : Add Alias to Union query
I have the following union query:
SELECT ProductId, ProductCode, ProductDescription FROM qryProductsStockTakeAdjust
mentReport
UNION SELECT Ast, Desc FROM tblAsterisk
ORDER BY Productcode;
It does not run because the number of columns do not match. How do I add an alias to get the same numbe rof columns on each side?
Answer : Add Alias to Union query
For example, add Null:
SELECT ProductId, ProductCode, ProductDescription FROM qryProductsStockTakeAdjust
mentReport
UNION SELECT Ast, [Desc], Null FROM tblAsterisk
ORDER BY Productcode;
Note: DESC is a reserved keyword.
(°v°)
Random Solutions
Search for Procedure SQL Server
Setting up OKI C5100n on Windows Vista Business (32 bit)
Combo box strange behavior
Mail-Merge Methods C#
vbscript SQL Server 2005 calling SP
Strategy for Interpreting Questionnaire Responses on Report
Can Dell Poweredge 2950 run SBS 2008
image in datalist
Restrict Textbox to Number and Decimal character only
URGENT: Need help parsing string for several numeric values SQL database columns