>>>>> "Alain" == Alain Fontaine <alain@stripped> writes:
Alain> I am running the latest Win32 shareware version (not yet registered) on
Alain> I have a database containing about 7 tables. The main table is called
Alain> "products", containing computer equipment.
Alain> This table contains 9 records.
Alain> When I do the following SELECT statement:
Alain> select products.prod_id,products.name,products.costprice,
Alain> manufacturer.webpage, currencies.ISO, currencies.rate,
Alain> from products, manufacturer, currencies, sub_categories
Alain> where products.manufacturer=manufacturer.num
Alain> and products.currency=currencies.ISO
Alain> and products.category_2 = sub_categories.num
Alain> and products.name LIKE '%pent%'
Alain> OR manufacturer.name LIKE '%int%'
Alain> the query return 2295 rows (obviously, with 9 records in my products table,
Alain> this seems strange).
You don't have any braces around:
'OR manufacturer.name LIKE '%int%''
This means that you say:
'for any combination of the rows of all preceding tables', give me all
rows that has 'int' somewhere in name.
I assume you want to do something like
and products.category_2 = sub_categories.num
and (products.name LIKE '%pent%'
OR manufacturer.name LIKE '%int%')