我在MySQL Community Server 5.5.16中编写一个存储过程,我需要在那里插入ID,该ID应该自动递增并且是唯一的。我不确定该怎么做。我应该使用这样的东西:
Declare Z AUTO_INCREMENT UNIQUE;
最佳答案
将字段Number
设置为NOT NULL AUTO_INCREMENT
并在插入sql INSERT INTO Account(Customer, Credit) VALUES(pCustomer,0);
中