Duplicate an SQL Record

When working with SQL databases there are times you want to clone database rows and for whatever reason don't want to write out a ton of INSERT statements.  This would be easily handled by

insert into users select * from user where username="webuser1";

except that this will not handle unique key contraints, i.e. when your ssn or user_id fields must remain unique.  One convenient way to get around the restrictions on unique keys it to create a temporary table, clone the record, change necessary fields, then copy is back to the original table.
CREATE TEMPORARY TABLE users2 ENGINE=MEMORY SELECT * FROM users 
WHERE username="webuser1";
UPDATE users2 SET username=webuser2; ## Change the username to be unique
## Update any other fields that must be unique
INSERT INTO users SELECT * FROM users2;
DROP TABLE users2;