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
How do I align a SilverLight 2 DataGrid column right in XAML?
Refer to page in tab control by name
Width animation of grid
how to export datatable to Excel using Save dialog in VB.NET
sql server 2008 Express
Remove leading zeros
"You don't have the license required to use this Active X Control"
Network Icons in Taskbar NOT Working Properly
Access 2003 the default printer become the fax,when my command button called fax is clicked?
Moving and Renaming Files using Excel/VB