Hi there
I have come accross this problem. I want to get all the childs which are not parents (last node on the model tree, so that I will end up with the actual models and not model lines) I use this SQL statement but the result in null.

select * from CC_MODEL
where ccactiveflag = 1 and ccModelId NOT IN (
select distinct ccParentId from CC_MODEL where ccactiveflag = 1 )

Am I missing something or it will just never work.
I have tried this query and it worked.

select * from CC_MODEL
where ccactiveflag = 1 and ccModelId NOT IN (10,11)

where numbers in brackets are some of the results from the query
select distinct ccParentId from CC_MODEL where ccactiveflag = 1

Any ideas???
Thanks