0

how can I let sql/mysql set the next id, that I have no problems with posts at the same time?

4

1 回答 1

0
CREATE TABLE Persons
(
ID int NOT NULL AUTO_INCREMENT,
LastName varchar(255) NOT NULL,
FirstName varchar(255)
)

Auto_Increment可以用作 ID,因为不会有任何重复值。
为表插入值时:

INSERT INTO Persons (FirstName,LastName)
VALUES ('Hello','World')

该表将如下所示。

ID | FirstName | LastName
1  |   Hello   |  World
于 2013-11-01T03:28:02.977 回答