Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

mysql copy row with new id

CREATE TEMPORARY TABLE tmp SELECT * FROM sitelog WHERE 1=1;
ALTER TABLE tmp DROP COLUMN `ID`;
INSERT INTO sitelog SELECT 0, tmp.* FROM tmp;
DROP TEMPORARY TABLE tmp;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #mysql #copy #row #id
ADD COMMENT
Topic
Name
9+9 =