View Single Post

   
  #5 (permalink)  
Old 03-01-2008, 12:14 PM
Erland Sommarskog
 
Posts: n/a
Default Re: Using LIKE in a CASE statement

(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/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Reply With Quote