I have a table with just about 100 columns, and I would like to duplicate a
row exactly, except for one column, which is the AUTO_INCREMENT column.

Using 'INSERT INTO tbl_name SELECT * FROM tbl_name WHERE id_col = 1' doesn't
work, because it produces the following error: 'ERROR 1062: Duplicate entry
'1' for key 1'.

Because I'd like the application using this database to be simpler to
maintain, I'd prefer to not have to change the code each time a field is
added...so is there a way to duplicate a row, but still have it
automatically assigned an value for the AUTO_INCREMENT column?

Thanks,

Eric


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

  • ... ΝΙΚΟΣ ΓΑΤΣΗΣ
    • ... Nitin
      • ... ΝΙΚΟΣ ΓΑΤΣΗΣ
    • ... Fortuno, Adam
    • ... Eric J. Janus
      • ... Matt Chatterley
        • ... Eric J. Janus
          • ... Matt Chatterley
            • ... Eric J. Janus
    • ... Henrik Schröder
      • ... Eric J. Janus

Reply via email to