Return-Path: X-Original-To: apmail-jackrabbit-users-archive@minotaur.apache.org Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A851617690 for ; Mon, 6 Oct 2014 17:21:37 +0000 (UTC) Received: (qmail 49051 invoked by uid 500); 6 Oct 2014 17:21:37 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 48997 invoked by uid 500); 6 Oct 2014 17:21:37 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 48984 invoked by uid 99); 6 Oct 2014 17:21:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Oct 2014 17:21:36 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [67.216.74.212] (HELO mis1979as.maned.com) (67.216.74.212) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Oct 2014 17:21:10 +0000 Received: from MIS1979AS.HQ.MANED.com ([::1]) by MIS1979AS.HQ.MANED.com ([::1]) with mapi id 14.01.0355.002; Mon, 6 Oct 2014 13:21:08 -0400 From: Morrell Jacobs To: "" Subject: JCR-SQL2 Query Problem With Joins Thread-Topic: JCR-SQL2 Query Problem With Joins Thread-Index: AQHP4YnqPtZfRL7iDU+IWFnTX6ub2g== Date: Mon, 6 Oct 2014 17:21:08 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.1.6.31] Content-Type: text/plain; charset="Windows-1252" Content-ID: <5D155CE119473348A23905ECD068A185@maned.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Setup: I want to run a JCR-SQL2 query that selects nodes based on an attrib= ute of a descendant node. I have created the query (see below) that does the work, but returns both n= odes (the ancestor & descendant). From the googling, =93SELECT parent.*=94= should cause the query to only return the ancestors / parent nodes, but I = haven=92t been able to get it to work. Looking for advice - what am I doing wrong? - or whether anyone else has se= en this problem. Thanks Morrell Query: SELECT parent.* FROM [ancestorNodeType] AS parent INNER JOIN [descendantNod= eType] as child ON ISDESCENDANTNODE(child,parent) WHERE child.[descendantPr= operty] =3D CAST('true' AS BOOLEAN)