SQLite在原表基础上重新排序id
SQLite数据库的id行由于操作会出现不连续的情况 , 现有如下语句可重新对其进行排序 .
insert or replace into table_1(id,name)
select (select count(*)+1 from accts where id < a.id),name
from table_1 a
where id = a.id
个人网站: Github , 欢迎给星
SQLite数据库的id行由于操作会出现不连续的情况 , 现有如下语句可重新对其进行排序 .
insert or replace into table_1(id,name)
select (select count(*)+1 from accts where id < a.id),name
from table_1 a
where id = a.id
个人网站: Github , 欢迎给星