[thelist] [SQL] Case vs Decode

rudy r937 at interlog.com
Mon Mar 3 19:11:07 CST 2003

> Just as a matter of interest - anyone know of any articles / have any
comments on
> when and where it is better to use a CASE statement, as opposed to DECODE?

oh, man, ain't it great when i can find good examples via google faster than
i could write something similar myself --

"DECODE is a bastardized and non-standard version of CASE statement"

"The CASE expression supports the use of SELECT statements for performing
Boolean tests, which the DECODE statement does not allow."

it would not surprise me to learn that DECODE goes quite far back in terms
of when it was first available in the oracle sql language, whereas CASE is
probably a more recent addition

in any case, i'd use CASE, in, um, all cases ...


More information about the thelist mailing list