[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: SQL to get WORKING from NODES

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Fri, 24 Sep 2010 12:52:32 +0100

Philip Martin <philip.martin_at_wandisco.com> writes:

>> This leads on to the problem of selecting just the highest op_depth
>> for each child. Is it possible to get one query to return just the
>> highest op_depth for each child?
>
> I suspect we will still want to do this at some point.

This was suggested:

SELECT * FROM nodes as n
 WHERE wc_id = ?1
   AND parent_relpath = ?2
   AND op_depth = (SELECT MAX(op_depth) FROM nodes as m
                    WHERE m.wc_id = n.wc_id
                      AND m.local_relpath = n.local_relpath
                      AND m.op_depth > 0);

which I think does what I want.

-- 
Philip
Received on 2010-09-24 13:53:36 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.