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: 2108
Registered: October 2003
Location: Hyderabad, India
Senior Member
Have you googled?
insert with select
Modify appropriately.

Previous Topic: how to find previous day
Next Topic: Opposite of TRUNC
Goto Forum:

Current Time: Sat Aug 19 17:35:33 CDT 2017

Total time taken to generate the page: 0.04843 seconds