Re: [sqlite] First "SELECT" query fails

2009-09-13 Thread Dan Kennedy
On Sep 14, 2009, at 1:35 PM, wrote: > Hi, > Any help to the below problem is of great help. Please check if this happens with 3.6.18. I think these issues may be fixed now. Dan. > Regards, > Reddy > > -Original Message- > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-bo

Re: [sqlite] First "SELECT" query fails

2009-09-13 Thread purushotham.kotapalle
Hi, Any help to the below problem is of great help. Regards, Reddy -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Kotapalle Purushotham (Nokia-D/Bangalore) Sent: Tuesday, September 08, 2009 12:57 PM To: sqlite-users@sqlite.

[sqlite] Undesired query plan when using GROUP BY

2009-09-13 Thread George Bills
Hi all, I was wondering if someone here could help me with understanding / solving an sqlite problem I'm having. Any help would be appreciated. =SCHEMA= CREATE TABLE pop_words_wpk ( word_id INTEGER PRIMARY KEY, occurrences INTEGER ); CREATE INDEX pop_words_wpk_oidx ON pop_words_wpk(occur

Re: [sqlite] one liner for insert or update ?

2009-09-13 Thread UIT DEVELOPMENT
I see this: CREATE TABLE table1( id INTEGER PRIMARY KEY ON CONFLICT REPLACE, field1 TEXT ); but I think that the table has to already have been created this way. I found that in the docs: http://sqlite.org/lang_conflict.html Would that help the OP? On Sun, Sep 13, 2009 at 6:56 PM, Jean-Christ

Re: [sqlite] one liner for insert or update ?

2009-09-13 Thread UIT DEVELOPMENT
Geez. I am sorry. You are correct. This is MySQL. Sorry about that and to the OP. (banging forehead with open faced palm of my hand!!!) Tony On Sun, Sep 13, 2009 at 6:56 PM, Jean-Christophe Deschamps wrote: > > > ´¯¯¯ >>INSERT INTO 'mytable' (key, 'visitorcount', 'visitdate') >>VALUES (12

Re: [sqlite] one liner for insert or update ?

2009-09-13 Thread Jean-Christophe Deschamps
´¯¯¯ >INSERT INTO 'mytable' (key, 'visitorcount', 'visitdate') >VALUES (123456789, 1, NOW()) >ON DUPLICATE KEY UPDATE 'visitorcount' = 'visitorcount' + 1 > >the key statement being: ON DUPLICATE KEY UPDATE > >not tested but it seems like that is what you are looking for. Its >sometimes refered t

Re: [sqlite] one liner for insert or update ?

2009-09-13 Thread UIT DEVELOPMENT
Are you wanting something like this: INSERT INTO 'mytable' (key, 'visitorcount', 'visitdate') VALUES (123456789, 1, NOW()) ON DUPLICATE KEY UPDATE 'visitorcount' = 'visitorcount' + 1 the key statement being: ON DUPLICATE KEY UPDATE not tested but it seems like that is what you are looking for.

Re: [sqlite] one liner for insert or update ?

2009-09-13 Thread yogibabu
Doug-4 wrote: > > Wouldn't "INSERT OR REPLACE" do that for you? (which by the way, has to be > one of the coolest features in SQLite of all!) > > http://www.sqlite.org/lang_insert.html > insert or replace deletes all rows that weren't specified in the query, i don't know maybe in combination