i must be honest and tell you that your c and c2 tables make me confused
the answer to your question is yes, you can get products at two different levels, by using a UNION query
Code:
SELECT p.id_prod
, p.id_cat
, p.nome_prod
FROM categoria one
INNER
JOIN categoria two
ON two.id_cat = one.parent_id_cat
INNER
JOIN produto p
ON p.id_cat = two.id_cat
WHERE one.parent_id_cat =2
UNION ALL
SELECT p.id_prod
, p.id_cat
, p.nome_prod
FROM categoria one
INNER
JOIN produto p
ON p.id_cat = one.id_cat
WHERE one.parent_id_cat =2
that might not run for your situation but i trust you will get the idea from it
Bookmarks