Re: [sqlite] How to join 3 tables?

2009-10-07 Thread Kermit Mei
On Tue, 2009-10-06 at 21:14 -0700, Darren Duncan wrote: > Kermit Mei wrote: > > How can I do it in only one sql command? I wrote it like this, but it > > can't run: > > sqlite> SELECT ZGroupItem.ZPhDevId HomeDev.text FROM ZGroupItem > >...> INNER JOIN ZPhDev O

Re: [sqlite] How to join 3 tables?

2009-10-06 Thread Kermit Mei
On Wed, 2009-10-07 at 12:10 +0800, Kermit Mei wrote: > Hello, I have three tables like this: > > HomeDev(id,...,text) > ZPhDev(id,...,HomeDevId) > ZGroupItem(id,...,groupId,ZPhDevId) > > Now, I want to get the items like this: > > ZPhDev.id, and its corresponding

[sqlite] How to join 3 tables?

2009-10-06 Thread Kermit Mei
Hello, I have three tables like this: HomeDev(id,...,text) ZPhDev(id,...,HomeDevId) ZGroupItem(id,...,groupId,ZPhDevId) Now, I want to get the items like this: ZPhDev.id, and its corresponding HomeDev.text, the relation is like this: 1. Get ZGroupItem.ZPhDevId When I know groupId 2. Get

Re: [sqlite] How to speed up a query between two tables?

2009-09-15 Thread Kermit Mei
On Tue, 2009-09-15 at 22:31 +1000, John Machin wrote: > On 15/09/2009 7:25 PM, Kermit Mei wrote: > > On Tue, 2009-09-15 at 17:37 +1000, John Machin wrote: > >> On 15/09/2009 4:47 PM, Kermit Mei wrote: > >>> > >>> sqlite> SELECT HomeDev.text, ZPhDev.id

Re: [sqlite] How to speed up a query between two tables?

2009-09-15 Thread Kermit Mei
On Tue, 2009-09-15 at 17:37 +1000, John Machin wrote: > On 15/09/2009 4:47 PM, Kermit Mei wrote: > > Hello community! > > > > I have two tables: > > > > HomeDev(id, text, icon) > > > > and > > > > ZPhDev(id,HomeDevId) > > >

Re: [sqlite] Can multi-column index optimize my operation?

2009-08-13 Thread Kermit Mei
On Thu, 2009-08-13 at 23:39 -0400, Igor Tandetnik wrote: > Kermit Mei wrote: > > The mostly useful SQL sentence is (MyDevId is known by user): > > > > SELECT * FROM KeyItem WHERE HomeDevId=MyDevId order by pageNum; > > > > Now, the items of this table may be

[sqlite] Can multi-column index optimize my operation?

2009-08-13 Thread Kermit Mei
firstly, so I don't know how to manipulate it? Just create a index like this, or any more operation is needed? Thanks Kermit Mei ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] How to import an empty value(NULL) into database from a file?

2009-07-02 Thread Kermit Mei
Hello, how can I import an empty value into the database from a file. The filed may be int or string, if I write "NULL" , then I'll read a string "NULL" from it. I hope that I can get an empty value (Eg, an empty string whose size() is zero in Qt). How can I do ? Thanks. Kermit

Re: [sqlite] How to build mutil-primary key for a table?

2009-07-01 Thread Kermit Mei
On Wed, 2009-07-01 at 22:45 -0400, Igor Tandetnik wrote: > Kermit Mei wrote: > > I have three table like this: > > > > Device(id,name,icon,type) -id as primary key > > > > ZWavePhsicalDevice(id,funcode) -id as primary key > > > > ZWaveGS

[sqlite] How to build mutil-primary key for a table?

2009-07-01 Thread Kermit Mei
the ZWaveGSDevice(...) in sqlite3 ? Hope any help. Thank you, very much! Kermit Mei ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] What's the different of the types TEXT and VARCHAR in sqlite3?

2009-06-25 Thread Kermit Mei
On Wed, 2009-06-24 at 14:21 +0200, Martin.Engelschalk wrote: > Hi, > > type names do not matter in sqlite, see http://www.sqlite.org/datatype3.html > > Martin > Yes, I see. Thank you:) ___ sqlite-users mailing list sqlite-users@sqlite.org

[sqlite] What's the different of the types TEXT and VARCHAR in sqlite3?

2009-06-24 Thread Kermit Mei
Hello, I'm a newbie for sqlite3, I hope somebody can tell me what's the different of TEXT and VARCHAR. Does TEXT can save arbitrary characters, but VARCHAR? Which is better, then? Thanks. ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] How can I create an automatically generated primary key id column.

2009-06-14 Thread Kermit Mei
在 2009-06-14日的 18:33 +0100,Simon Slavin写道: > On 14 Jun 2009, at 4:43pm, Kermit Mei wrote: > > > But I want to insert values from a file underlinux, > > and I don't want write any code for it. > > Okay, that kind of information is important enough to appear in your / >

Re: [sqlite] How can I create an automatically generated primary key id column.

2009-06-14 Thread Kermit Mei
在 2009-06-14日的 14:50 +0100,Simon Slavin写道: > On 14 Jun 2009, at 2:23pm, Kermit Mei wrote: > > > I want to create a new table, its primary key is an int 'id' column, > > but > > I don't want to insert the data by hand, I hope the system can > > generate > >

[sqlite] How can I create an automatically generated primary key id column.

2009-06-14 Thread Kermit Mei
Hello, community! I want to create a new table, its primary key is an int 'id' column, but I don't want to insert the data by hand, I hope the system can generate it by adding id. For example, mytable(id, name, age) When I insert name and age, the id is generated automatically. And another