Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: DECODE OR CASE
On Fri, 2 Jul 2004 11:41:05 +0500, "Oracle Newbie"
<f93c0532_at_yahoo.com> wrote:
>How is it possible to use the DECODE function or CASE statement to implement
>some thing like this
>
...
case / decode will both work ....
(depends on which version of the DB you wish to run on and your
performance requirements .. )
Case is *MUCH* easier to read & to maintain.
If you wish to use decode - then you will need to use the greatest or
least functionality
ie decode(greatest(salary,1200), salary,
decode(greatest(salary,1500), salary, ... ) , 0 )
For the CASE expression I suggest you see the oracle sql manual in particular the "Simple CASE Example" and the "Searched CASE Example". There are very simple examples there. Received on Sat Jul 03 2004 - 05:38:18 CDT
![]() |
![]() |