Hi, >Yes the parent node, there might be multiple child nodes, so the one >with the latest timestamp would take precedent.
OK I see. So for relational databases, the query would be something like this: drop all objects; create table parent(id int); insert into parent values(1); create table child(id int, pid int, d date); insert into child values(10, 1, '2001-01-01'); insert into child values(11, 1, '2001-01-02'); select * from parent p order by (select max(d) from child c where c.pid = p.id); Unfortunately, the neither JCR API nor Oak (nor Jackrabbit 2.x) support subqueries and aggregate functions ("max"). Derived tables and group by is also not supported, so I think there is no way to express this as a JCR query. Would it be possible to store the 'latest timestamp' in the parent? That would simplify the query a lot. Regards, Thomas