gpt4 book ai didi

mysql - mysql 表列中的数字未按正确顺序插入

转载 作者:行者123 更新时间:2023-11-29 20:12:00 24 4
gpt4 key购买 nike

我正在使用 MySQL Workbench 6.3。我有一个包含两列 id 和成分的表。但 id 值没有正确插入。检查图像以供引用。我已经尝试过以下两个查询

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);

但是输出是相同的。id 列值不按顺序排列。 id列截图:

enter image description here

最佳答案

行的显示顺序是任意的,但通常可能是按照插入顺序。如果您希望它们按某种特定顺序排列:

SELECT * FROM ingredients ORDER BY id

关于mysql - mysql 表列中的数字未按正确顺序插入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40032240/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com