Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle Magazine Blooper
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
![]() |
![]() |