You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Morrell Jacobs <mj...@maned.com> on 2014/10/06 19:21:08 UTC

JCR-SQL2 Query Problem With Joins

Setup: I want to run a JCR-SQL2 query that selects nodes based on an attribute of a descendant node.

I have created the query (see below) that does the work, but returns both nodes (the ancestor & descendant).  From the googling, “SELECT parent.*” should cause the query to only return the ancestors / parent nodes, but I haven’t been able to get it to work.

Looking for advice - what am I doing wrong? - or whether anyone else has seen this problem.

Thanks
Morrell



Query:

SELECT parent.* FROM [ancestorNodeType] AS parent INNER JOIN [descendantNodeType] as child ON ISDESCENDANTNODE(child,parent) WHERE child.[descendantProperty] = CAST('true' AS BOOLEAN)