List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:December 19 2002 6:41pm
Subject:Re: INSERT... SELECT Statement fails when...
View as plain text  
At 12:19 -0500 12/19/02, Andrew Kuebler wrote:
>When I run an INSERT. SELECT query and I am inserting the records into a
>new table that has a UNIQUE key, the statement will fail as soon as it
>hits a "Duplicate entry" error. No further entries will be inserted. The
>only way I know to get around this is to pull the entire column(s) into
>memory and insert them back in one by one with a repeating INSERT
>statement. Can anyone tell me the "easy" way to do this? (I assume there
>must be a better way) Thanks!

Either use INSERT IGNORE or REPLACE, depending on whether you want
to ignore subsequent duplicates or use them to replace earlier duplicates.


>
>Andrew

Thread
INSERT... SELECT Statement fails when...Andrew Kuebler19 Dec
  • Re: INSERT... SELECT Statement fails when...Paul DuBois19 Dec
  • Re: INSERT... SELECT Statement fails when...Keith C. Ivey19 Dec
  • Re: INSERT... SELECT Statement fails when...Michael T. Babcock19 Dec
  • re: INSERT... SELECT Statement fails when...Victoria Reznichenko20 Dec