Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: A simple Sql question
On Wed, 1 Jul 1998 08:59:30 +0200, Abiy Alemu
<abiy_at_biotec.jouy.inra.fr> wrote:
> 0001 STATION1 150
> 0002 STATION2 250
> 0003 STATION2 253
> 0004 STATION2 350
> 0005 STATION3 400
>
>And I would like to, by an update statement have the following
> staion_number station_reference power
>
> 0001 STATION1 150
> 0002 STATION2 250
> 0003 STATION2-1 253
> 0004 STATION2-2 350
> 0005 STATION3-3 400
>or renaming in some other simple way.
>
>Is it possible to do it. If it is, how ?
Use the following update statement (if column 3 is unique)
update table1
set column2 = decode (column3 ,253,'STATION2-1' ,350,'STATION2-2' ,400,'STATION3-3'); ------------------------------------------------------------------------------- --- Martin Jesterhoudt--- martinj(replace this by @)xs4all.nl