Expand my Community achievements bar.

SQL2 Query - Select all nodes that have no children

Avatar

Level 5

I'm trying to find all nodes that have no children.

Here is what I have so far

select * from [nt:unstructured] as p where isdescendantnode (p, [/content]) AND NAME(p) like 'col%' AND [sling:resourceType] IS NULL

That's where I'm a little confused ....

I would like to have something like this (pseudo code obviously)

select * from [nt:unstructured] as p where isdescendantnode (p, [/content]) AND NAME(p) like 'col%' AND [sling:resourceType] IS NULL AND HASCHILDNODE() == false

Any help is greatly appreciated.

Thanks,

-Dean

1 Reply

Avatar

Level 10

I am going to run some tests and will post back.