I have an issue.
I have a single table that houses a parent/child data relationship:
When I run this query:
FROM categories a
JOIN categories b ON a.idcategory = b.idparentcategory
WHERE NOT ((a.idcategory = 1 AND a.idparentcategory = 1) AND (b.idcategory = 1 AND b.idparentcategory = 1))
I get these results:
What I am trying to do is write a single query that will disable the parent category only when all child categories are disabled.
Please help... I am stuck.