I need to copy a row in a table but have the id auto increment and also change one of the values in the new row
I am very close, my sql will copy the row and increment the id, but how do I change one of the fields. Here is what I have that will copy the row with id 11, insert a new row with the next available id
Is it possible to modify this to insert the value 'newvalue' into field4 but still copy the rest of the values?
Thanks
I am very close, my sql will copy the row and increment the id, but how do I change one of the fields. Here is what I have that will copy the row with id 11, insert a new row with the next available id
Code:
INSERT INTO mytable SELECT 0, `field1`, `field2`, `field3`, `field4`, `field5`
FROM mytable WHERE id = 11
Is it possible to modify this to insert the value 'newvalue' into field4 but still copy the rest of the values?
Thanks