MySQL default value as other field's value
问题 Can I, and, if I can, how can I set the default value of a field in a MySQL table to the value of another field? Thing is: I have data, and each data object has its ID in the table. But, I would like the possibility to rearrange the data, changing their sorting index, without altering their ID. Thus, the field sort_num should by default be set to the value given to the auto-incremented indexed field ID . Thanks in advance! 回答1: I see two possible solutions for this: 1. Possibility: You use a