If you take Jochem's working query that gave no results you should
consider changing the INNER JOINs to LEFT JOINs since this will find
matching rows in the first table you list and then matching rows from
the tables on the right of the LEFT JOIN. If there is no match you see
a NULL for any va
Try this..
FROM auction_item_categories AS A INNER JOIN
auction_item_categories_sub AS S1 ON A.id = S1.category_id) INNER JOIN
auction_item_categories_sub1 AS S2 ON S1.id = S2.category_id) INNER JOIN
auction_item_categories_sub2 AS S3 ON S2.id = S3.category_id) INNER JOIN
auction_item_cate
Why don't you create a many -> many relationship if you want to use
multiple categories?
Table: auction_item
Table: auction_category
Table: item_category
You only have to use 2 joins here, one join for getting category data,
and one for getting category relations.
SELECT DISTINCT AI.Label, AC.L
Thanks Mike. I will consider your suggestions about putting all the data into
one table. I did have a look at that database you mention and the layout was
compelling.
However, if the querying would still cause me headaches I would be no further
ahead. Behind in fact, because I've had to redesig
> From: Michael T. Tangorre [mailto:[EMAIL PROTECTED]
I forgot to change something when copy/pasting.
SELECT
A.name
FROM
auction_item_categories A
INNER JOIN auction_item_categories_sub S1
ON (A.id = S1.category_id)
INNER JOIN auction_item_catego
> From: Protoculture [mailto:[EMAIL PROTECTED]
> The Last Code I tried was Jochems and while it did run
> succesfully, there were no results returned. Essentially What
> I'm doing is selecting all related categories from the where
> all the ( auction_item_categories_sub.category_id = 1 ) and
6 matches
Mail list logo