Re: why not work?
gianpaolo fabiani wrote:
> How can I duplicate record in the same table with
> only a new id?
With the following table definition:
mysql> desc templ;
+-------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------+--------------+------+-----+---------+----------------+
| id | int(11) | | PRI | NULL | auto_increment |
| f1 | varchar(100) | YES | | NULL | |
| f2 | varchar(100) | YES | | NULL | |
+-------+--------------+------+-----+---------+----------------+
you can do the following:
INSERT INTO templ (id, f1, f2)
SELECT NULL, f1, f2
FROM templ
WHERE id= <<some_id>>;
--
felix
Subject
Written By
Posted
Re: why not work?
April 07, 2005 05:15AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.