Set default value of field to auto_increment value
问题 I have a table where I have an auto increment column id and another column ord . My goal is to have a 'default' value for ord that is id . I am using a trigger (see below), but it always uses 0 instead of the id value. When I remove the auto_increment from id , it works as it should. How can I set the 'default' value of a field to the one of an auto_increment field? Table CREATE TABLE IF NOT EXISTS `mytable` ( `id` int(11) NOT NULL AUTO_INCREMENT, `ord` int(11) DEFAULT NULL, PRIMARY KEY (`id`