Re: [sqlite] simple question about database lookup

2010-01-13 Thread Jay A. Kreibich
On Tue, Jan 12, 2010 at 04:12:01PM -0500, Qianqian Fang scratched on the wall: > On 1/12/2010 4:08 PM, Jay A. Kreibich wrote: >> SELECT group_concat( value ) FROM mydata WHERE id IN ( 'id_1', 'id_2', ... ) > > thank you very much for your quick response. I guess this will be > significantly faster

Re: [sqlite] simple question about database lookup

2010-01-13 Thread Qianqian Fang
On 1/12/2010 5:36 PM, Kees Nuyt wrote: > There is a maximum list size the parser can cope with. > Internally "id IN (val1,val2,...valN)" > is converted to > "WHERE id = val1 OR id = val2 OR id = valN" > > http://www.sqlite.org/limits.html > > I think here > 5. Maximum Depth Of An Express

Re: [sqlite] simple question about database lookup

2010-01-12 Thread Kees Nuyt
I forgot one question. On Tue, 12 Jan 2010 16:12:01 -0500, Qianqian Fang wrote: >One more question, will this work if you have a >long list of ids (say a few hundred)? There is a maximum list size the parser can cope with. Internally "id IN (val1,val2,...valN)" is converted to "WHERE id = v

Re: [sqlite] simple question about database lookup

2010-01-12 Thread Kees Nuyt
On Tue, 12 Jan 2010 16:12:01 -0500, Qianqian Fang wrote: >On 1/12/2010 4:08 PM, Jay A. Kreibich wrote: >> SELECT group_concat( value ) FROM mydata WHERE id IN ( 'id_1', 'id_2', ... ) >> > >hi Jay > >thank you very much for your quick response. I guess this will be >significantly faster than l

Re: [sqlite] simple question about database lookup

2010-01-12 Thread P Kishor
On Tue, Jan 12, 2010 at 3:12 PM, Qianqian Fang wrote: > On 1/12/2010 4:08 PM, Jay A. Kreibich wrote: >> SELECT group_concat( value ) FROM mydata WHERE id IN ( 'id_1', 'id_2', ... ) >> > > hi Jay > > thank you very much for your quick response. I guess this will be > significantly faster than loopi

Re: [sqlite] simple question about database lookup

2010-01-12 Thread Qianqian Fang
On 1/12/2010 4:08 PM, Jay A. Kreibich wrote: > SELECT group_concat( value ) FROM mydata WHERE id IN ( 'id_1', 'id_2', ... ) > hi Jay thank you very much for your quick response. I guess this will be significantly faster than looping through each id. One more question, will this work if you h

Re: [sqlite] simple question about database lookup

2010-01-12 Thread Jay A. Kreibich
On Tue, Jan 12, 2010 at 04:00:51PM -0500, Qianqian Fang scratched on the wall: > hi > > My knowledge to sql is very limited. So forgive me if this sounds > really simple to you. I want to do a lookup operation with sqlite: > I have a table (id, value), where id is an index field, now I have > a li

Re: [sqlite] Simple question about optimization

2007-12-10 Thread Clodo
Thanks Dan, your answer it's exactly what i want to know. Thanks again! On 10/12/2007, Kees Nuyt <[EMAIL PROTECTED]> wrote: On Mon, 10 Dec 2007 12:22:53 +0100, Clodo <[EMAIL PROTECTED]> wrote: In this case: - CREATE TABLE test ( Field01 text PRIMARY KEY NOT NULL,

Re: [sqlite] Simple question about optimization

2007-12-10 Thread Dan
On 10/12/2007, Kees Nuyt <[EMAIL PROTECTED]> wrote: On Mon, 10 Dec 2007 12:22:53 +0100, Clodo <[EMAIL PROTECTED]> wrote: In this case: - CREATE TABLE test ( Field01 text PRIMARY KEY NOT NULL, Field02 text ); insert into test values ('alpha','beta'); update test

Re: [sqlite] Simple question about optimization

2007-12-10 Thread Cesar D. Rodas
On 10/12/2007, Cesar D. Rodas <[EMAIL PROTECTED]> wrote: > > What Kess Nuyt is asking is if you want to replace a column with a data, > which is the data, will SQLite update it or SQLite is smart enough for > avoid write the same thing?, very important for keep executing time, > because write some

Re: [sqlite] Simple question about optimization

2007-12-10 Thread Cesar D. Rodas
What Kess Nuyt is asking is if you want to replace a column with a data, which is the data, will SQLite update it or SQLite is smart enough for avoid write the same thing?, very important for keep executing time, because write something to HDD is very expensive. I hope I understand well your ques

Re: [sqlite] Simple question about optimization

2007-12-10 Thread Kees Nuyt
On Mon, 10 Dec 2007 12:22:53 +0100, Clodo <[EMAIL PROTECTED]> wrote: >In this case: > >- >CREATE TABLE test ( > Field01 text PRIMARY KEY NOT NULL, > Field02 text >); > >insert into test values ('alpha','beta'); > >update test set Field01='alpha', Field02='gamma'; >-

RE: [sqlite] Simple question

2005-08-31 Thread Thomas Briggs
August 31, 2005 7:35 AM > To: Massimo Gaspari > Subject: Re: [sqlite] Simple question > > Hello Massimo, > > Wednesday, August 31, 2005, 7:19:27 PM, you wrote: > > MG> Is there any way to check if a table (in an opened > database) exists? > MG> Somet

Re: [sqlite] Simple question

2005-08-31 Thread Sergey Startsev
Hello Massimo, Wednesday, August 31, 2005, 7:19:27 PM, you wrote: MG> Is there any way to check if a table (in an opened database) exists? MG> Something smarter than "SELECT * FROM TABLENAME". ? Select * from sqlite_master where name = 'TABLENAME' -- Best regards Sergey Startsev SQLite Ana