List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:April 29 2002 9:01pm
Subject:Re: Query to insert not in
View as plain text  
At 17:36 -0300 4/29/02, Oswaldo Castro wrote:
>Hi List
>
>I have two tables inside a MySQL DB. The first one has 30 Millions records
>(30.000.000) say it Table-A . The second one has 500 Thousands Records
>(500.000) say it Table_B. I need that all the records from Table-B to be
>inserted in Table-A. Because an operator error many of the records from
>Table-B is already present at Table-A but not all of them.

Use INSERT IGNORE.

>
>I think I can do two things
>
>1 - Delete Table-B from Table-A where key-B = key-A and after that, insert
>all Table-B into Table-A
>2 - Create an intermediary table say it Table-C that has all the records
>from the Table-B not present at the Table-A and insert that Table-C
>afterward
>
>Is there any other and better (more fast) way to do this?
>
>Please any help will be very, very appreciated.
>
>Greetings
>
>Oswaldo Castro
Thread
Query to insert not inOswaldo Castro29 Apr
  • Re: Query to insert not inPaul DuBois29 Apr
  • Re: Query to insert not inBenjamin Pflugmann29 Apr
  • Re: Query to insert not inSteve Buehler30 Apr