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

Home -> Community -> Usenet -> c.d.o.misc -> Re: A simple Sql question

Re: A simple Sql question

From: replace this with _at_ <_at_)xs4all.nl>
Date: Thu, 02 Jul 1998 17:51:31 GMT
Message-ID: <359aa167.1479397@news.xs4all.nl>


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
Received on Thu Jul 02 1998 - 12:51:31 CDT

Original text of this message

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