Re: [sqlite] Getting max column on empty table

2004-03-17 Thread Kurt Welgehausen
Instead of (select max(c) from t where n=20)+1 try select coalesce(max(c)+1, 1) from t where n = 20 Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

[sqlite] Getting max column on empty table

2004-03-17 Thread Steve Palmer
If I have a table that is empty and I want to compute an incrementing value in a non-unique column (I cannot use integer primary key since the column value won't be unique): (select max(c) from t where n=20)+1 where c is unique only within (n==20), then this works as long as the table has at