List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:May 24 2002 2:33am
Subject:Re: Help with REPLACE INTO statement syntax
View as plain text  
At 21:27 -0500 5/23/02, Andrew Lietzow wrote:
>Dear MySQL wizards,
>
>I have two tables, call them A and B.   The database structure is identical. 
>I want the records in B to overwrite the records in (REPLACE INTO) A. 
>
>This is the statement that does NOT work.
>
>REPLACE INTO a SELECT b.* FROM b WHERE a.field1 = b.field1
>
>I also tried this with the last the conditional statement reversed.  MySQL
>doesn't like my syntax.   The field names in A are identical to B. 
>
>TIA for any help.  
>
>--
>Andrew Lietzow
>The ACL Group, Inc.

The SELECT part has to be a legal SELECT statement, which yours
isn't.  (The WHERE part names two tables, but the FROM part names
only one.)
Thread
Help with REPLACE INTO statement syntaxAndrew Lietzow24 May
  • Re: Help with REPLACE INTO statement syntaxPaul DuBois24 May
    • Re: Help with REPLACE INTO statement syntaxAndrew Lietzow27 May