mysql AUTO INCREMENT field
Translation results:
auto
UK[ˈɔ:təʊ] US[ˈɔ:toʊ]
n.<US>Automobile
vi. By car
Third person singular: autos Plural: autos Present participle: autoing Past tense: autoed Past participle: autoed
##increment
英[ˈɪŋkrəmənt ] US [ˈɪnkrəmənt, ˈɪŋ-] n. Increment; growth; increase; regular salary increasePlural: incrementsmysql AUTO INCREMENT fieldsyntax
Function:Generate a unique number when a new record is inserted into the table
Description:We usually want to automatically generate a unique number every time a new record is inserted into the table. Create the value of the primary key field. We can create an auto-increment field in the table.
mysql AUTO INCREMENT fieldexample
//把 "Persons" 表中的 "P_Id" 列定义为 auto-increment 主键 CREATE TABLE Persons(P_Id int NOT NULL AUTO_INCREMENT,LastName varchar(255) NOT NULL,FirstName varchar(255),Address varchar(255),City varchar(255),PRIMARY KEY (P_Id));
Popular Recommendations
- Tesla's latest patent promises auto-positioning for effortless wireless EV charging
- Python Library that auto-solves TikToks captchas and lets you upload/schedule videos with TikTok sounds and hashtags
- Sony unveils HXR-NX800 and PXW-Z200 professional camcorders with 4K 120fps, 24-480mm zoom, AI autofocus, live streaming, and auto-subject framing