Re: [sqlite] next value in sequence

2010-08-31 Thread Max Vlasov
On Tue, Aug 31, 2010 at 9:07 AM, Eric Smith wrote: > > You probably don't want 'SELECT max(foo_id)+1' because I think that does > a full table scan. > > you're right, but slightly modified version SELECT (SELECT max(foo_id) FROM MxVft_FTIndex)+1 does not Max

Re: [sqlite] next value in sequence

2010-08-31 Thread Scott Frankel
On Aug 30, 2010, at 10:07 PM, Eric Smith wrote: > Scott Frankel wrote: > >> Hi all, >> >> How does one find the next value of a serial item? Given a simple >> table with a serial primary key, I'd like to get the next available >> integer key value. eg: >> >> CREATE TABLE foo ( >> foo_id

Re: [sqlite] next value in sequence

2010-08-31 Thread Eric Smith
Scott Frankel wrote: > Hi all, > > How does one find the next value of a serial item? Given a simple > table with a serial primary key, I'd like to get the next available > integer key value. eg: > > CREATE TABLE foo ( > foo_id SERIAL PRIMARY KEY, > name

[sqlite] next value in sequence

2010-08-30 Thread Scott Frankel
Hi all, How does one find the next value of a serial item? Given a simple table with a serial primary key, I'd like to get the next available integer key value. eg: CREATE TABLE foo ( foo_id SERIAL PRIMARY KEY, nametext