Re: [sqlite] 3 tables in relation, really slow ...

2004-09-07 Thread Simon Berthiaume
Have you tried to change the order of the conditions in the WHERE clause? I don't know the internal working of SQLite so they might actualy give worst results. You can try something like that: SELECT date_ext.mydate as MyDate, city_ext.city as MyCity, number_ext.mynum as MyNumber FROM city_ext, nu

[sqlite] Query maximum JOIN

2004-08-11 Thread Simon Berthiaume
rning data, but not anymore. Thank you for your time. Simon Berthiaume

Re: [sqlite] A proposal for SQLite version 3.0

2004-04-07 Thread Simon Berthiaume
It might be true if you mostly store large quantities of NUMERICAL data (float, int, ...) since they are currently stored as strings (the value 1234567, would be stored using at least 7-8 bytes instead of 4). If you were in the same situation as I, where I use database mostly for strings, you would

Re: [sqlite] How to use last_insert_rowid()?

2004-04-06 Thread Simon Berthiaume
Here are 2 tables to use in our example: CREATE TABLE t1 ( t1_pk INTEGER PRIMARY KEY, t1_value VARCHAR(20) ); CREATE TABLE t2 ( t1_fk INTEGER, t2_id INTEGER, t2_value VARCHAR(20) ); t1_pk would be the primary key on your main table (t1), t1_fk would be foreign key to t1_pk an

[sqlite] Feature of "FROM" clause

2004-03-22 Thread Simon Berthiaume
Hi, given the following tables: CREATE TABLE table_1(id INTEGER PRIMARY KEY,column VARCHAR(64)); CREATE TABLE table_2(id INTEGER PRIMARY KEY,column VARCHAR(64)); I realized that the following query isn't valid in SQLite: SELECT * FROM ( table_

Re: [sqlite] Inner join problem

2004-03-09 Thread Simon Berthiaume
plaisir de pouvoir aider un confrère. Simon B. On Tue, 2004-03-09 at 09:00, Guillermo Fernandez Castellanos wrote: > Sweet... works right perfect. > > Can it be considered as a bug? > > Merci beaucoup! > > Guille > > Simon Berthiaume wrote: > > I think I

Re: [sqlite] Inner join problem

2004-03-09 Thread Simon Berthiaume
I think I know what the problem is. SQLite doesn't like having a table name following an openint parenthesis "(" in the FROM clause. Try the following statements instead: SELECT main.id, prim.primname, sec.secname FROM main INNER JOIN sec ON main.se

Re: [sqlite] ORDER BY failure (?)

2004-02-11 Thread Simon Berthiaume
What behavior were you trying to achieve? Putting a conditional statement (test1 > 100) in a GROUP BY clause isn't valid SQL. Simon B. On Tue, 2004-02-10 at 17:54, Andox wrote: > Hello everybody. > > I have a question about the SELECT command with UNION ALL. > > When executing the followin

Re: [sqlite] qualified join

2004-01-23 Thread Simon Berthiaume
I had a similar problem recently, the way I solved it looks like that (it might not be pretty, but it works) SELECT t1.name, t2.deleted FROM t2 INNER JOIN ( SELECT t2.id, MAX(t2.time) AS last_time FROM t2 GROUP BY t2.id ) AS t3 ON t2.id = t3

Re: [sqlite] Query problem

2004-01-21 Thread Simon Berthiaume
nding that out. Simon Berthiaume On Mon, 2004-01-19 at 16:37, Simon Berthiaume wrote: > Maybe I used a too simplistic example. I have code that generates SQL > queries so users can request reports with various fields, various > criterias and various sorting orders. So technicaly there

Re: [sqlite] Query problem

2004-01-19 Thread Simon Berthiaume
QLite will support in the future (how close in the future) or a feature that will never be supported. Thank you all for your time Simon Berthiaume On Mon, 2004-01-19 at 14:24, Kurt Welgehausen wrote: > If you look at the SQLite grammar in lang.html, you'll see > that parentheses are n

Re: [sqlite] Query problem

2004-01-19 Thread Simon Berthiaume
LEFT JOIN ( SELECT * FROM INSCLAIMS_CONCAT WHERE ( INSCLAIMS_CONCAT_FIELD_ID = 'INSCLAIMS_POLICYNO' ) ) AS T1 ON T1.INSCLAIMS_ID = T0.INSCLAIMS_ID ) ; Simon Berthiaume On Mon, 2004-01-19 at 12:52, D. Richard Hipp wrote:

[sqlite] Query problem

2004-01-19 Thread Simon Berthiaume
aximum degree of "inner-ness" in queries? Simon Berthiaume

[sqlite] Bug or "feature" in sqlite_exec?

2004-01-19 Thread Simon Berthiaume
e much greater and we understand it may come at the expense of RAM usage. So please no comment on how I could re-write the query. If anyone can tell me why sqlite_exec behaves like that, it would be appreciated. Simon Berthiaume