re: [sqlite] Query locking up SQLite

2005-08-10 Thread David Fowler
David Fowler wrote: Query 2: SELECT * FROM table1, table2 WHERE ((table1.value LIKE "%value%" AND table1.table2_id = table2.id) > OR (table1.value LIKE "%different_value%" AND table1.table2_id = table2.id)); This query (and even more complex versions of it) works i

Re: [sqlite] New Query Question

2005-07-27 Thread David Fowler
sqlite.org User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en References: <[EMAIL PROTECTED]> X-Virus-Scanned: amavisd-new at supernerd.com Return-Path: [EMAIL PROTECTED] X-OriginalArrivalTime: 27 Jul 2005 01:51:47.0466 (UTC) FILETIME=[BF9AD6A0:01C5924D] Da

Re: [sqlite] New Query Question

2005-07-26 Thread David Fowler
Really sorry guys, AS files, should indeed be AS tables, thats what does not work. Sorry again for the copy/pasting/editing error. When I remember to name everything correctly, I still can't select anything by table.column sytax that is in the derived table, wether the derived table is aliased

Re: [sqlite] New Query Question

2005-07-26 Thread David Fowler
Really sorry guys, AS files, should indeed be AS tables, thats what does not work. Sorry again for the copy/pasting/editing error. When I remember to name everything correctly, I still can't select anything by table.column sytax that is in the derived table, wether the derived table is aliased

[sqlite] New Query Question

2005-07-26 Thread David Fowler
Hello again to everyone. I'm having trouble with the following query: SELECT tables.id FROM ( SELECT table4.location, table4.id FROM table1 INNER JOIN table2 ON (table1.class_id = table2.class_id) INNER JOIN table3 ON (table2.name_id = table3.name_id) INNER JOIN table4 ON (table4.id = table3.id)

Re: [sqlite] Query locking up SQLite

2005-07-25 Thread David Fowler
> SQLite Version 3.2.2. > Is this a bug, or is my SQL that bad? > Query 1: > SELECT * FROM table1, table2 > WHERE (table1.value LIKE "%value%" AND table1.table2_id = table2.id); > This query works perfectly, can't fault it. > But when I do this, SQLite locks out (Command line interface, and PHP5)

Re: [sqlite] Query locking up SQLite

2005-07-25 Thread David Fowler
Might I suggest the following -- make your query in steps, and note where it actually starts slowing down. For example, Step 1. SELECT COUNT(*) FROM t1 (took a fraction of a pico second... good) Step 2. SELECT COUNT(*) FROM t1 WHERE t1.c1 = 'c1' (took a couple of fractions of a pico

Re: [sqlite] Query locking up SQLite

2005-07-25 Thread David Fowler
I think if you try this with MySQL MyISAM you will have the same result and I think this is to do with the SELECT * I remember I used to have something similar back in the days when I tried MySQL. Charlie == I just tried adding extra conditions in

Re: [sqlite] Query locking up SQLite

2005-07-25 Thread David Fowler
On 2005-07-25 at 13:06:42 [+0200], David Fowler <[EMAIL PROTECTED]> wrote: > SELECT count(*) FROM table1 > INNER JOIN table2 ON (table1.id = table2.rel_id) > INNER JOIN table3 ON (table3.rel_id = table2.id) > INNER JOIN table4 ON (table3.id = table4.rel_id) > INNER JOIN tab

Re: [sqlite] Query locking up SQLite

2005-07-25 Thread David Fowler
On 2005-07-25 at 10:58:04 [+0200], David Fowler <[EMAIL PROTECTED]> wrote: > Thanks Charlie, thats exactly how I should be doing it. I would imagine > there are some performance benefits from doing it this way too. Now I've > just got to make it work for my select that involves six

Re: [sqlite] Query locking up SQLite

2005-07-25 Thread David Fowler
On 2005-07-25 at 10:15:14 [+0200], David Fowler <[EMAIL PROTECTED]> wrote: > SELECT * FROM table1, table2 > WHERE (table1.value LIKE "%value%" AND table1.table2_id = table2.id); > This query works perfectly, can't fault it. > But

Re: [sqlite] Query locking up SQLite

2005-07-25 Thread David Fowler
this statement has an extra ; which may be the error. Another thought, when quoting string literals, it is better to use single quotes('), since double quotes(") means identifier --column name-- first, string literal second. John == Thanks for the very

[sqlite] Query locking up SQLite

2005-07-25 Thread David Fowler
SQLite Version 3.2.2. Is this a bug, or is my SQL that bad? Query 1: SELECT * FROM table1, table2 WHERE (table1.value LIKE "%value%" AND table1.table2_id = table2.id); This query works perfectly, can't fault it. But when I do this, SQLite locks out (Command line interface, and PHP5) Query 2: