[eluser]MEM[/eluser]
Is it possible to use UNION trough Active Record Class ?
What I'm trying to create using Active Record Class is:
Code:
SELECT p.id_prod, p.id_cat, p.nome_prod
FROM produto p
INNER JOIN categoria c ON c.id_cat = p.id_cat
INNER JOIN categoria c2 ON c.parent_id_cat = c2.id_cat
WHERE c2.parent_id_cat = 1
UNION
SELECT p.id_prod, p.id_cat, p.nome_prod
FROM produto p
INNER JOIN categoria c ON c.id_cat = p.id_cat
WHERE c.parent_id_cat = 1 OR p.id_cat = 1
Can I have your experiment eyes on this?
Thanks a lot,
Márcio