[sqlite] Generate a unique id unless it is provided

2011-03-29 Thread Tobias Vesterlund
Hi, I got a table in my database which looks like the following: A | B | C 1 | 119 | 0 1 | 120 | 1 1 | 121 | 0 2 | 120 | 2 2 | 121 | 2 I want the A value to be generated for the bold rows (ie first inserts of each 'linked' item) and I'd like to

[sqlite] 'integer'

2011-04-16 Thread Tobias Vesterlund
Hi, I ran into something I don't understand, maybe someone here can shed some light on it for me. I have a table named Tg which is created (with tcl) by: CREATE TABLE Tg (TgConfigId INTEGER PRIMARY KEY AUTOINCREMENT, OtherColumn INTEGER); If I do: INSERT INTO Tg (TgConfigId) VALUES

[sqlite] max() with LIMIT

2011-08-31 Thread Tobias Vesterlund
Hi, I'm want to get the max value out of a certain column in a table. Table t has a column named id, which ranges from 0 to 99. If I do SELECT max(id) FROM t; it will return 99. If I do SELECT id FROM t WHERE id > 0 LIMIT 10; it will return 1,2,3,4,5,6,7,8,9,10 But If I do SELECT max(id) FROM

Re: [sqlite] max() with LIMIT

2011-08-31 Thread Tobias Vesterlund
Right you are, thank you! Regards, Tobias -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Ivan Shmakov Sent: den 31 augusti 2011 10:13 To: sqlite-users@sqlite.org Subject: Re: [sqlite] max() with LIMIT >>>