Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle Magazine Blooper

Re: Oracle Magazine Blooper

From: FlameDance <flamedance_at_gmx.de>
Date: Mon, 10 May 2004 20:38:35 +0200
Message-ID: <c7oi7g$gr5$05$1@news.t-online.com>


Brian Peasland wrote:

>>And for anyone interested in a possibly more reasonable approach:
>>
>>SELECT parameter,
>>CASE WHEN parameter < 1000 THEN 'C' ELSE 'P' END AS BAND
>>FROM parameter_table;

Nice and precice.

> SELECT parameter,DECODE(SIGN(parameter-1000),-1,'C','P') AS band
> FROM parameter_table;
> 

I hate DECODE with a passion. It's like C: short, fast - and unreadable. Rather than this I'll have the much scowled at original (after cleaning up the two RETURN statements), at least I know at 1 glance what it does.

Stephan Received on Mon May 10 2004 - 13:38:35 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US