Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以我在表中添加了一列用于编号。我想浏览表中的所有行并从 1 开始编号。你会怎么做呢?
只需使用AUTO_INCREMENT. 它将自动更新您现有的行和所有未来的行。
AUTO_INCREMENT
ALTER TABLE tablename CHANGE id id INT(10) AUTO_INCREMENT PRIMARY KEY;