You are here: Re: Using LIKE in a CASE statement « MsSQL Server « IT news, forums, messages
Re: Using LIKE in a CASE statement

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация