I need to grab all categories that don't have subcategories
1
^--1.1
^--1.2
^--1.2.3
2
^--2.1
3
In this example I would want to get [1.1], [1.2.3], [2.1] and [3].
My Categories table looks like this:
CategoryID | CategoryName | ParentID
I figure I should be selecting all the categories where it's CategoryID isn't used in any other category's ParentID field but I'm at a loss as to how to write that.