You need to get all the leafs:)? Unfortunately there is not bit field in CMS_category table to tell if a category node has children or not. But you can easily achieve this with simple SQL query:
select p.* from CMS_Category p left outer join CMS_Category c on p.CategoryId = c.CategoryParentID
where c.Categoryid is null
Give me all categories that don't have any children