Groups | Blog | Home
all groups > sql server mseq > july 2004 >

sql server mseq : Update


mottu
7/29/2004 4:22:06 AM

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

Hugo Kornelis
7/29/2004 2:05:18 PM
[quoted text, click to view]

Hi Mottu,

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

Best, Hugo
--

AddThis Social Bookmark Button