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
Illegal operation attempted on a registry key that has been marked for deletion
Deny Ability to open additional mailboxes in Outlook
Crystal reports report based on dataSet in VS 2005. How to.
Is it possible to create a "Quick Find" button in Excel? (I need to make searching idiot proof.)
IIS generates 500 Internal Server Error when using PHP to connect to MySQL
Fields in the query change since it is a special char
Uploading a file into sql server database using Image datatype
ISA Vs Squid Proxy
Assistance with Internet Explorer 7
Combine data from two separate tables.fields into one Query field