In MySQL, how can I use the autoincrement value in another column at the time of the INSERT?
- 阅读更多 关于 In MySQL, how can I use the autoincrement value in another column at the time of the INSERT?
问题 I am looking to have the automagically set autoincrement included in another column during the insert. For example in a table where ID is the autoincrement and Name is the other column, I'd like to do something like `INSERT INTO Names (Name) VALUES (CONCAT("I am number ",ID));` Currently, I do the INSERT without Name, then I have to immediately after do an UPDATE using $mysqli->insert_id. I don't want to query the table in advance because, as small a time as it may be, another record could