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

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

Re: Oracle Magazine Blooper

From: Brian Peasland <dba_at_remove_spam.peasland.com>
Date: Mon, 10 May 2004 16:03:20 GMT
Message-ID: <409FA7C8.1E67D8DB@remove_spam.peasland.com>


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

That's exactly what I was thinking of when I read the code in OraMag. And for those who don't have CASE (i.e. using an older version), a nice DECODE would do the trick:

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

Cheers,
Brian

-- 
===================================================================

Brian Peasland
dba_at_remove_spam.peasland.com

Remove the "remove_spam." from the email address to email me.


"I can give it to you cheap, quick, and good. Now pick two out of
 the three"
Received on Mon May 10 2004 - 11:03:20 CDT

Original text of this message

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