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