Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Eliminating Double Values from a Table

Status
Not open for further replies.

maximilllian

Vendor
Feb 21, 2005
1
RU
Hi There -

I need to consolidate data from many adress databases, which i allready sucessfully put into one table1. As Newbie i am reviing the Manuals and tutorials, but in 2 days i learned a lot about the powerfull command, but not how to solve the following question:

Is there a straight forward method to copy data from one table1 into the other table2, but not those rowse, which have same value in Fieldx.

All my Update and INSERT SELECT experiments somehow created more then less data in the target table.

Any Hint appreciated
Max
 
Have you tryed to SELECT DISTINCT , this way you won't get dublicate entryes from the DB.

staffa
 
You could use:
[tt]
INSERT IGNORE tbl2 SELECT * FROM tbl1
[/tt]
This will discard any records which would result in duplicate-key conflicts.
 
Information is gold. I didn't know INSERT IGNORE even exists :)

Thanks TonyGroves.

staffa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top