My CodeIgniter/DataMapper site needs to display a list of categories. Each category has a many-to-many relationship with itself, for multiple parents/children. I want to initially select only the categories with with no parents, or in other words, with no objects connected through a specified relationship.
I’ve run through a couple of possibilities (like including the related object count in the select and adding it to the where clause, which doesn’t work because WHERE is evaluated before generating the column values in SQL), but to no avail.
Advice? Thank you.