Re: Update

From: Hugo Kornelis (hugo_at_pe_NO_rFact.in_SPAM_fo)
Date: 07/29/04


Date: Thu, 29 Jul 2004 14:05:18 +0200

On Thu, 29 Jul 2004 04:22:06 -0700, mottu wrote:

>
>I've Emp table with empno, name, dept. The data for the
>dept are A,B,C
>
>I want to update that table Edu for A, Sport for B,....
>using self join in single statement.
>
>is it possible?
>
>
>Regs,
>Mottu
>

Hi Mottu,

UPDATE Emp
SET dept = CASE dept
               WHEN 'A' THEN 'Edu'
               WHEN 'B' THEN 'Sport'
               ELSE dept
              END
(untested)

Best, Hugo

-- 
(Remove _NO_ and _SPAM_ to get my e-mail address)