select * from tableName order by id asc
应该是这样,主要是 order by 这个关键字。asc是升序,desc是降序。
create table test(ID int)
insert into test select 1 union all select 4 union all select 2 union all select 9 union all select 6 union all select 14 union all select 12
select * from test order by ID
不是变成 1,2,3,4,5,6,7,8,9
而是变成 1,2,4,6,9,12,14
如果你要1,2,3,4,5,6,7,8,9那你就需要自增字段了
select * from abc order by id