how about:
insert into <table_name> select * from <table_name> where <select criteria>

is the primary key an auto sequence?



-----Original Message-----
>From: Scott Haneda <[EMAIL PROTECTED]>
>Sent: Sep 14, 2006 5:06 PM
>To: MySql <mysql@lists.mysql.com>
>Subject: Cloning or duplicating a record
>
>Can someone tell me how to take one record and duplicate it exactly, with
>the exception of the pk, which I want to increment as usual.
>
>I think I need insert select, however, I don't want to name all the fields,
>as it would break over time, if I add or subtract fields.  I seem to recall
>using a wildcard tossed me up an error about a duplicate key.
>-- 
>-------------------------------------------------------------
>Scott Haneda                                Tel: 415.898.2602
><http://www.newgeo.com>                     Novato, CA U.S.A.
>
>
>
>-- 
>MySQL General Mailing List
>For list archives: http://lists.mysql.com/mysql
>To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
>


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to