Home » SQL & PL/SQL » SQL & PL/SQL » Update table from same table
Update table from same table [message #187186] Fri, 11 August 2006 04:24 Go to next message
Messages: 3
Registered: July 2006
Junior Member
Hello all,

I have the following problem which need help.

I have a table with the following data.

City/Qty Qty1 Qty2 Qty3
New York 12 23 34
Washington 34 45 98
New Jersey 12 25 34

What i need is a update statement that copy Qty2 and update to Qty3 for each row as below:

City/Qty Qty1 Qty2 Qty3
New York 12 23 23
Washington 34 45 45
New Jersey 12 25 25

Is there a way to do it?

Thanks a million

Re: Update table from same table [message #187187 is a reply to message #187186] Fri, 11 August 2006 04:27 Go to previous message
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Well, based off the information provided,
UPDATE <tablename>
SET qty3 = qty2;

would seem to do the trick.

Previous Topic: HOWTO: Column name for a SELECT obtained from an inner SELECT.
Next Topic: Not null constraint inside CTAS stmt
Goto Forum:

Current Time: Sun Oct 23 03:34:01 CDT 2016

Total time taken to generate the page: 0.22168 seconds