0
我正在使用MySQL Workbench 6.3。我有一個兩列id和成分的表。但是id值沒有正確插入。檢查圖像以供參考。我曾經嘗試都低於查詢mysql表中的數字沒有以正確的順序插入
create table ingredients(id int(6) primary key not null, ingredient varchar(30) not null unique);
和
create table ingredients(id int(6) primary key not null auto_increment, ingredient varchar(30) not null unique);
但輸出是same.id列值犯規進來順序。 id列的截圖:
通過ID子句添加以查詢。 – Shadow
請嘗試使用'VARCHAR(255)',除非您有一個非常有說服力的理由來限制其他情況。 'VARCHAR(30)'不保存任何空間,它只會產生潛在的截斷錯誤。同樣,使用'INT'作爲默認值,而不是像'INT(6)'這樣的古怪變體。 – tadman