Complex Query

Complex Query

am 15.04.2010 22:42:04 von Mimi Cafe

--0015174c111805c2c704844c873c
Content-Type: text/plain; charset=ISO-8859-1

I have three tables from which I need to query for a keyword. The 3 tables
are products, productsubcategories and productcategories. Fron these three
tables, I need to query for a product name or keywork starting with the
products table. if the keyword is not found in the product name or
product_description, then I need to extra any products who parent table
(productsubcategories) name matches the search keyword or any products who
grandparent table (productcategories) category name matches the keyword.

Here is what I thought should work, but it doesn't:

select product_name, product_short_description, product_price from products\
inner join product_subcategories inner join product_categories where
product_name = 'sat nav' or product_name like '%sat nav%'\
or product_short_description like '%sat nav%' or
product_subcategories.subcategory_name like '%sat nav%'\
or product_categories.category_name like '%sat nav%';


Now I am begin to wonder whether it is possible to retrieve the required row
using a query.

Mimi

--0015174c111805c2c704844c873c--