You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by Marco Piovesana <pi...@esteco.com> on 2020/03/04 11:39:28 UTC

compare properties of two nodes in sql2 query

Hi all,
I'm trying to write a query to get the list of files having different
creators compared to their parents. The query looks like this:

SELECT child.* FROM [custom:file] AS child
    INNER JOIN [custom:folder] AS parent ON ISCHILDNODE(child,parent)
    WHERE ISDESCENDANTNODE(child, '/SomeFolder') AND
                  child.[custom:ownerId] <> parent.[custom:ownerId]

From what understand I understand I can't compare properties of two
different nodes (or even the same node) in the WHERE clause, am I right? Is
there any way to do it?
I have a lot of data in the repository and being able to add the
restriction on the "custom:ownerId" property would shrink a lot result set.

Marco.