Re: SQL doubt Urgent !!!!

From: Markus Stuhlpfarrer <mstuhlpfarrer_at_hollomey.com>
Date: Fri, 31 Aug 2001 05:25:32 GMT
Message-ID: <3B8F1F77.22B0DBC6_at_hollomey.com>


simply go on with the decode
decode syntax is
decode(column,condition,value,condition2,value2,...,value_for_else)

Select Decode(position,'A',5,'B',6,'R',10,'T',1) from table ;

if you want to keep the values of "position" is not A,B,R or T then the statement is:
Select Decode(position,'A',5,'B',6,'R',10,'T',1,position) from table ;

Jeferson wrote:

> How to use the parameter Decode in SQL
>
> This is what I want.
>
> Old value New value
> A 5
> B 6
> R 10
> T 1
>
> if I write a single SQL
>
> Select Decode(position,'A',5) from table ;
>
> works fine, but how to do all the above table ?
>
> Jeferson
>
> Any Ideas would be great !
Received on Fri Aug 31 2001 - 07:25:32 CEST

Original text of this message