Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: If clause in SELECT statements

Re: If clause in SELECT statements

From: Hakan <heren_at_home.com>
Date: 2000/07/18
Message-ID: <3974B827.7359204B@home.com>#1/1

hi,

you can use decode function.

select decode(state, 'NY', 'New York', state) as state_desc from state_tab

Hakan

Tim Gifford wrote:
>
> Is there any way to evaluate a field in a SELECT query w/o writting a User
> Function? This is an example of the logic that I would like to have in a
> view:
> select if([state]='NY','New York',[state]) as state_desc from state_tab
>
> If the state column is NY then it would output New York, otherwise, it would
> return the value from the field.
>
> Any Ideas,
> Tim Gifford
> tgifford(at)horizonstech.com
Received on Tue Jul 18 2000 - 00:00:00 CDT

Original text of this message

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