KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
My table has two keys, one is an auto incrementing id (PRIMARY), the other is the name of the item (UNIQUE). Is it possible to duplicate a row within this same table? I have tried: INSERT INTO items SELECT * FROM items WHERE id = '9198' This gives the error Duplicate entry '9198' for key 'PRIMARY' I have also tried: INSERT INTO items SELECT * FROM items WHERE id = '9198' ON DUPLICATE KEY UPDATE id=id+1 Which gives the error Column 'id' in field list is ambiguous And as far as the item name (UNIQUE) field goes, is there a way to append (Copy) to the item name, since this field must also be unique?
Tags (comma-separated)
Save Edits
Cancel