Thomas Spahni wrote:
Hi suomi,
it can be done with a temporary table. See the following example.
Regards,
Thomas Spahni
CREATE TEMPORARY TABLE duptemp SELECT * FROM duprows WHERE id = 2;
ALTER TABLE duptemp CHANGE id id INT NULL;
UPDATE duptemp SET id = NULL;
INSERT INTO duprows SELECT * F
Hi suomi,
it can be done with a temporary table. See the following example.
Regards,
Thomas Spahni
USE test;
CREATE TABLE duprows (
id INT NULL AUTO_INCREMENT PRIMARY KEY,
content VARCHAR(255)
) TYPE=MyISAM;
INSERT INTO duprows VALUES(NULL, 'some text'),(NULL, 'some other text
your PRIMARY KEY is an auto_increment field, just omit foo_ID from
the columns list in both the INSERT and SELECT.
-Original Message-
From: suomi [mailto:[EMAIL PROTECTED]
Sent: Friday, August 19, 2005 7:08 AM
To: mysql@lists.mysql.com
Subject: SELECT ... INTO OUTFILE ... and LOAD DATA
Hi listers
I once asked if there is an SQL syntax permitting to copy a row in the
same table. I got no answer, so there is no such syntax.
now i meant to have found a work-around using (see subject).
problem is, that when i do a SELECT * ... INTO OUTFILE .. i will also
catch the PRIMARY KEY c