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: Update question

Re: Update question

From: Maija-Leena Kangasmäki <maija-leena.kangasmaki_at_tieto.com>
Date: 1998/10/12
Message-ID: <3621B653.F8E74477@tieto.com>#1/1

Try DECODE:

UPDATE table SET department = DECODE(department,'AA','OAA','VC','VCA') where department IN ('AA','VC');
or
UPDATE table SET department =
DECODE(department,'AA','OAA','VC','VCA',department);

Regards,

Maija-Leena

Paul Schattling wrote:

> Is it possible to use an 'if' in an UPDATE statement. i.e. If I have a
> column in a table called Departments and it is made up of various values
>
> (like 'AA' and 'VC') and I want to SET these to be 'OAA' and 'VCA' (not
> always the same change) do I have to run it one by one manually or can I
> update them using an IF
> statement somehow? I have about 50 different Departments to update, of
> which there are about 95 records for each.
>
> Thanks in advance!
Received on Mon Oct 12 1998 - 00:00:00 CDT

Original text of this message

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