Let's look at the example below:
Create Table tbl_xxx (
'F _ id' int (10) Not null auto_increment comment 'id ',
'F _ province 'int (10) Not null default '0' comment' province ',
'F _ node' varchar (60) not null default ''comment 'I business node ',
'F _ Day' date not null default '2017-01-01 'comment' date ',
'F _ timesect 'int (6) Not null default '0' comment' time period (1-24 )',
'F _ failnum' int (10) Not null default '0' comment' failure count ',
'F _ sucessnum' int (10) Not null default '0' comment' successful times ',
'F _ avspeed' int (12) not null default '0' comment 'average access speed ',
Primary Key ('f _ Day', 'f _ id '),
Key 'f _ province '('f _ province', 'f _ node', 'f _ timesect ')
)
The primary key of the script above specifies two fields f_day and f_id, and f_id sets the auto_increment attribute. In this case, the f_id of the entire table is counted from 1 according to the different values of f_day. For example, if f_day is '2017-08-11 ', f_id is counted from 1. If '2017-08-12', f_id is also counted from 1.
The f_id of all auto_increment data increases sequentially.