update
table
set id = id + 1
WHERE
id > 1

RBS


> Sorry about this, but this is a SQL question and not a SQLite specific
> question.
>
> Is there a way to increment a value in a table in-situ.   Without
> reading it, incrementing it, writing it?
>
> I need to insert an entry into a table, it has an id, all entries with
> id's >= the id need to be incremented to keep the id's unique
>
> ie
>
> 1 bob
> 2 joe
> 3 irene
>
> someone wants to insert 2 sarah, I need the table to look like this
>
> 1 bob
> 2 sarah
> 3 joe
> 4 irene
>
>
> Any help would be great.
> thanks
>
> -----------------------------------------------------------------
> Gregor
>
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>



_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to