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 when I do this, SQLite locks out (Command line interface, and PHP5)
> 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));

I think this is a good example of why I use explicit JOINS.

SELECT * FROM table1
INNER JOIN table2 ON
(table2.id = table1.table2_id)
WHERE 
table1.value LIKE '%value%' OR table1.value LIKE '%value%')

Doesn't this do what you want?
-- 
Charlie Clark
Communications Manager
yellowTAB GmbH
Tel: +49-211-600-3657
http://www.yellowtab.com
mailto: [EMAIL PROTECTED]

Reply via email to