YAN HONG YE <yanhong...@mpsa.com> wrote: > my database have a column named id auto_increament inter primary key, when I > delete any rows , the id item may be indiscriminate > , how to update it and reorder the column from 1 to max(id) order by id asc?
It's not quite clear what you are trying to achieve. Perhaps something like this: create temp table OldIds(id integer primary key); insert into OldIds select id from MyTable; update MyTable set id=1+(select count(*) from OldIds where OldIds.id < MyTable.id); drop table OldIds; -- Igor Tandetnik _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users