[thelist] Owed tip - SQL Decode as a quick fix for data quality

Ken Schaefer Ken at adOpenStatic.com
Wed Oct 5 16:50:53 CDT 2005


> -----Original Message-----
> From: thelist-bounces at lists.evolt.org [mailto:thelist-
> bounces at lists.evolt.org] On Behalf Of Luther, Ron
> Subject: RE: [thelist] Owed tip - SQL Decode as a quick fix for data
> quality
> 
> Ken Schaefer asked:
> 
> >>It may be helpful if you mention which DBMS this applies to.
> 
> Sorry. I realized that about an hour after I sent it.  The tip was
> intended for Oracle syntax.  However, IIRC, isn't "decode(column_name,
> value_1, revised_value_1, value_2, revised_value_2, ..., default)"
> fairly common and, in fact, the same syntax in MS-SS T-SQL as it is in
> Oracle PL/SQL?

I don't believe Decode() is part of the ANSI standard, and according to the
orafaq.com site "...is rarely implemented in other RDBMS offerings. It is one
of the good things about Oracle, but use it sparingly if portability is
required." 

Cheers
Ken


More information about the thelist mailing list