|
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]
|