[DISCUSSION] Recursive/Hierarchical Select
Bart Pietercil
bart.pietercil at cognosis.be
Fri Mar 6 08:18:49 CST 2009
On 06 Mar 2009, at 14:21, Ruslan Zasukhin wrote:
> On 3/5/09 8:58 PM, "Bart Pietercil" <bart.pietercil at cognosis.be>
> wrote:
>
>> 2) for selection of records from starting recid till specified level
>>
>>
>> select * from T1 where (recid IN DESCENDANTS linkname OF (recid =
>> 5) DOWN TO
>> LEVEL 3 INCLUSIVE/EXCLUSIVE STARTLEVEL)
>>
>> select * from T1 where (recid IN ASCENDANTS linkname OF (recid = 5)
>> UP TO
>> LEVEL 3 INCLUSIVE/EXCLUSIVE STARTLEVEL)
>>
>> This selects all recid from starting recid all branches up to or
>> down to the
>> specified level and you can specify if you want the startinglevel
>> inclusive or
>> not.
>> Startinglevel : it seems to me that there will be case where you
>> want to
>> exclude the starting level (since you already know this level
>> (otherwise you
>> could not give a startinglevel recid))
>
> Well, up to now I think we always have think about EXCLUSION of
> start level.
>
> query: Parents of Bart
> should not return Bart himself.
> right ?
Well I can live with that, it just feels like there will be occasions
where I would like that included the starting recid but I cannot
immediately find a case for this......
BArt
More information about the Valentina
mailing list