You are here: Re: Subquery in case statement « MsSQL Server « IT news, forums, messages
Re: Subquery in case statement

Posted by Erland Sommarskog on 05/24/05 01:52

(ryan.mclean@gmail.com) writes:
> Hi Erland, in Oracle, I would use a decode statement. It's a really
> easy way to perform . . . case statements i.e. decode(col, null, do
> something, do something else). Just a fun fact :) I'll look at the
> coalesce function; I'm sure that would work as well.
>
> I really appreciate both of your comments. I thought oracle and ms sql
> would be similar enough in syntax . . . not close enough apparently.

Did you think SQL was portable? You've been listening too much to
that Celko-man! :-)

Anyway, decode is apparently Oracle-specific. CASE is actually ANSI-SQL,
as is coalessce(). (But not isnull().


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp

 

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

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