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.
一个很简单的问题,但是如何在 MySQL 中创建一个触发器,在插入之前为“ID”列生成唯一的 ID?
你不需要触发器。只需在表结构中使用“auto_increment”选项设置列。
auto_increment 的文档