Igor has answered this before. Roughly: 1. all tables has an implicit integer column named "rowid" that is auto increment 2. creating an integer primary key effectively "renames" rowid to that column, so in your case below fields id and rowid are the same
IIRC drh replied something else, and since I'm not familiar with the internals I'm not sure if that is how it is implemented or an equivalent black-box model of how sqlite works. But since Igor is like the next authoritative guru here after drh himself, that explanation should be correct. Cheers, M. Manese On 8/9/07, Paul Harris <[EMAIL PROTECTED]> wrote: > I dislike answering myself, but no sooner I had sent that email, I tried this: > > sqlite> create table ghi (id integer primary key autoincrement, value text); > sqlite> insert into ghi (value) values ('justvalue'); > sqlite> insert into ghi (id,value) values (null,'withid'); > sqlite> select * from ghi; > id|value > 1|justvalue > 2|withid > sqlite> > > so, why doesn't auto_increment do either of the following more sensible > things: > 1) throw an error > 2) do what "autoincrement" does > > ? > > thanks > Paul > > ----------------------------------------------------------------------------- > To unsubscribe, send email to [EMAIL PROTECTED] > ----------------------------------------------------------------------------- > > ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------