MySql Insert Select uuid()
问题 Say you have a table: `item` With fields: `id` VARCHAR( 36 ) NOT NULL ,`order` BIGINT UNSIGNED NOT NULL And: Unique(`id`) And you call: INSERT INTO `item` ( `item`.`id`,`item`.`order` ) SELECT uuid(), `item`.`order`+1 MySql will insert the same uuid into all of the newly created rows. So if you start with: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa, 0 bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb, 1 You'll end up with: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa, 0 bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb, 1 cccccccc