Home » SQL & PL/SQL » SQL & PL/SQL » copy data from old table to new table.
copy data from old table to new table. [message #209884] Mon, 18 December 2006 04:52 Go to next message
Messages: 75
Registered: May 2005
Location: bxl
i have an old table (T1) with two columns (col1,col2) with a lot of data.

now we have a new table (T2) with four columns (id, zip, city, areacode). there are also already some data in this table, which may not be deleted.

we want to copy the data of T1 in T2, and T2 should look as follows:
- id should be retrieved from a sequence.
- zip is the old T1.col1
- city is the old T1.col2
- areacode should be temporary "null"

is there a way to write this in one script?

thanks in advance
Re: copy data from old table to new table. [message #209889 is a reply to message #209884] Mon, 18 December 2006 05:15 Go to previous message
vamsi kasina
Messages: 2107
Registered: October 2003
Location: Riyadh, Saudi Arabia
Senior Member
Have you googled?
insert with select
Modify appropriately.

Previous Topic: Help needed in query tuning
Next Topic: Undo
Goto Forum:

Current Time: Sun Oct 23 07:15:15 CDT 2016

Total time taken to generate the page: 0.08832 seconds