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 to run SSIS package until it succeeds
Printing mutipul pages VB.NET 2005
LinkMasterFields and LinkChildFields?
LINQ to SQL insertonsubmit, multiple instances before submitchanges
SelectedValue which is invalid because it does not exist in the list of items
Excel marco (digital to character )
ISA server in SBS 2003. is blocking a site, how do i allow?
where parameters aspx .net page
Trying to open Outlook 2000 PST in Outlook 2003
How can I check the size of a SharePoint 2007/Wss 3.0 sub site?