| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.oracle -> Re: using case, Valid statement?
I can use decode like:
decode(
field1,'first',1,
decode(field1,'second',2,0
)
)
except that this has to be all nested and is very hard to work with. If I have nine items it becomes very ugly.
Michael Hill wrote:
>
> Is this a valid sql statement:
>
> SELECT
> case field1
> when 'first' then 1
> when 'second' then 1
> else null
> end
> FROM mytable
>
> Mike
Received on Thu Feb 19 2004 - 10:49:27 CST
![]() |
![]() |