Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 47163 invoked from network); 29 Jul 2010 09:05:36 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 29 Jul 2010 09:05:36 -0000 Received: (qmail 43797 invoked by uid 500); 29 Jul 2010 09:05:36 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 43430 invoked by uid 500); 29 Jul 2010 09:05:34 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 43421 invoked by uid 99); 29 Jul 2010 09:05:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Jul 2010 09:05:32 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of aklimets@day.com designates 207.126.148.96 as permitted sender) Received: from [207.126.148.96] (HELO eu3sys201amo012.postini.com) (207.126.148.96) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 29 Jul 2010 09:05:26 +0000 Received: from source ([74.125.82.49]) by eu3sys201aob106.postini.com ([207.126.154.11]) with SMTP ID DSNKTFFEQG66Wa6ocbPxYtEjGuUs3/Y35BLU@postini.com; Thu, 29 Jul 2010 02:05:05 PDT Received: by wwb34 with SMTP id 34so98290wwb.6 for ; Thu, 29 Jul 2010 02:05:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.27.193 with SMTP id j1mr1993231wbc.137.1280394304516; Thu, 29 Jul 2010 02:05:04 -0700 (PDT) Received: by 10.227.131.21 with HTTP; Thu, 29 Jul 2010 02:05:04 -0700 (PDT) In-Reply-To: <005c01cb2e8d$7ec5a6a0$7c50f3e0$@de> References: <005c01cb2e8d$7ec5a6a0$7c50f3e0$@de> Date: Thu, 29 Jul 2010 11:05:04 +0200 Message-ID: Subject: Re: One Question about SQL2 From: Alexander Klimetschek To: dev@jackrabbit.apache.org Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org I think something like this could work (beware, untested): SELECT * FROM [my:a] AS p INNER JOIN child AS c ON ISDESCENDANTNODE(p, c) WHERE c.[jcr:primaryType] =3D 'my:b' AND c.Prop1 =3D 'test' Regards, Alex On Wed, Jul 28, 2010 at 21:45, Michael Coldewey wrote: > Hello, > > > > sorry, I know, ist the wrong mailinglist, but i am actually not member of > the users list. > > > > Perhaps someone would and could answer me. > > > > Till now I use XPATH for querying the repository, but now I want to chang= e > to SQL2. The samples in the test case explains the basics, but I didnt > found, how to make a query to find nodes, which have childs with specific > properties. > > > > [my:a] > > =A0=A0=A0 [my:b] > > =A0=A0=A0=A0=A0=A0 Prop1=3D=91test=91 > > > > > > I want every node [my:a] which have any child with the property =82Prop1= =91 and > value =82test=91. > > > > In xpath, this is really simple to solve, but i dont know to make it in > SQL2. > > > > It would be great, if someone give me a hint on this. > > > > Thanks a lot > > BR, > > Michael Coldewey > > > > --=20 Alexander Klimetschek alexander.klimetschek@day.com