Home » SQL & PL/SQL » SQL & PL/SQL » Query to Copy data from one table to nother
Query to Copy data from one table to nother [message #400318] Mon, 27 April 2009 09:14 Go to next message
g_rohit7
Messages: 2
Registered: April 2009
Junior Member
Hi,

I have a table

Table1
a b c d e f
1 1 1 1 1 1
1 1 1 2 1 3
1 1 1 3 1 4

In this table a,b,c,d are primary keys.

I have another table with the same columns as Table1 but with "a,b,c,e" as primry fields.

Now I want to copy the data of Table1 to Table2.

But the query
insert into Table2 ( select * from Table1) this gives unique constraint error.

Please suggest a query so that I can copy all the unique data (i.e in which cnmbinaton a,b,c,e are distinct) from Table1 to Table2?
Re: Query to Copy data from one table to nother [message #400319 is a reply to message #400318] Mon, 27 April 2009 09:21 Go to previous message
BlackSwan
Messages: 25036
Registered: January 2009
Location: SoCal
Senior Member
When (i.e in which cnmbinaton a,b,c,e are distinct) multiple rows exist, how to determine which goes in new table?
Previous Topic: Get record by length
Next Topic: Search the Table Name or Column Name by Column Values
Goto Forum:
  


Current Time: Sun Dec 04 06:10:00 CST 2016

Total time taken to generate the page: 0.08398 seconds