|
Posted by Erland Sommarskog on 02/04/07 10:49
(alberto.estrada1@gmail.com) writes:
> Thanks Erland, your solution did it. I don't understand how the
> second part of the syntax: SELECT DISTINCT 'Metals'
> FROM MYSAMPLES
>
> shows up as 'METALS'. I thought i would have had to select an AS
> somewhere...nonetheless it worked!!
Not sure what you mean. If it says METALS in all uppercase in the output,
something very strange is going on.
If you mean the column name, in a SELECT UNION statement the column
names are derived from the first SELECT, so there is no need to
provide column names for the subsequent SELECT:s.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
[Back to original message]
|