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: Ternary '?' in (PL/)SQL

Re: Ternary '?' in (PL/)SQL

From: Phil Preen <[obiwan-preen_at_maytheforcebewithyou.co.uk>
Date: Tue, 1 Feb 2000 17:06:02 -0000
Message-ID: <949424956.215150@red.parallax.co.uk>

<david_barts_at_my-deja.com> wrote in message news:8770q3$l5f$1_at_nnrp1.deja.com...
> Is there a way to simulate the '?' operator of C-like
> languages, e.g:
>
> select (char_column == 'Y' ? 'Yes' : 'No') from some_table
> where ... ;
>

try:

select DECODE(char_column, 'Y', 'Yes', 'No') from some_table where ... ;

Phil. Received on Tue Feb 01 2000 - 11:06:02 CST

Original text of this message

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