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: Conditional Select statement

Re: Conditional Select statement

From: Steve Bell <swayne.bell_at_sympatico.ca>
Date: Wed, 04 Apr 2001 18:14:36 GMT
Message-ID: <3ACB61CB.AA09FF99@sympatico.ca>

Hi Jon,
How about

SELECT DECODE(COLUMN1,'FAIL','THIS IS INCORRECT','THIS IS OK') RESULT FROM TESTINGTABLE; Hth,

Steve

Jon wrote:

> Hi,
>
> I would like to know if it is posible to add some conditional behaivour to a
> select statement. I mean that if have a table that contains sometimes the
> 'OK' value and 'FAIL' for other rows so I could create a statement that when
> the row contains 'OK' it would print 'this is the correct value' and on the
> other hand when it contains 'FAIL' it just prints 'this is not the correct
> value'
>
> Thanks for you help
>
> PS. this task is accomplish in SYBASE using 'CASE WHEN...'
  Received on Wed Apr 04 2001 - 13:14:36 CDT

Original text of this message

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