Home » SQL & PL/SQL » SQL & PL/SQL » update statement
update statement [message #218623] Fri, 09 February 2007 00:28 Go to next message
pavuluri
Messages: 247
Registered: January 2007
Senior Member
plz help me
i have table table1

id name
1 x
2 b


i want to update table1 like

id name
1 b
2 x

but i want to update that table using with in sigle update statemant is it possible

Re: update statement [message #218649 is a reply to message #218623] Fri, 09 February 2007 02:49 Go to previous message
pavuluri
Messages: 247
Registered: January 2007
Senior Member
yes i got it

UPDATE test set
name = (case when name ='b' then 'x'
when name = 'x' then 'b'
END)
where id in(1,2)

Thanks,
srinivas
Previous Topic: How to get a random number...
Next Topic: procedure(to increase buffer size)
Goto Forum:
  


Current Time: Thu Dec 08 02:00:58 CST 2016

Total time taken to generate the page: 0.14564 seconds