mitya
04-15-2010, 04:42 AM
Hi guys
Sure this must be simple, just not sure how to do it.
When replicating a row, how can I set the ON DUPLICATE KEY clause to update the PK with the next auto_increment id? I tried
insert into table select * from users where id = 1 on duplicate key update (select max(id)+1 from table)
...but it didn't like it.
Thanks in advance
Sure this must be simple, just not sure how to do it.
When replicating a row, how can I set the ON DUPLICATE KEY clause to update the PK with the next auto_increment id? I tried
insert into table select * from users where id = 1 on duplicate key update (select max(id)+1 from table)
...but it didn't like it.
Thanks in advance