Home » SQL & PL/SQL » SQL & PL/SQL » Update one column - multiple rows
Update one column - multiple rows [message #22953] Thu, 07 November 2002 08:17 Go to next message
Craig
Messages: 28
Registered: October 2001
Junior Member
Does anyone have any examples of code that allow you to update one column with multiple entries?

You can do this in 9i but, I'm using 8.1.7!!

Many thanks for any help.
Re: Update one column - multiple rows [message #22962 is a reply to message #22953] Thu, 07 November 2002 09:58 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
You can use DECODE or CASE. Here is a DECODE example:

update t
   set c = decode(c, 0, 5, 1, 10);


If c = 0, set to 5.
If c = 1, set to 10.
Previous Topic: querying based on a function
Next Topic: compute statistics
Goto Forum:
  


Current Time: Mon Apr 29 09:55:14 CDT 2024