>>Hi, Edgar!
>>
>>First of all, try to avoid using the reserved words as the field names
>>
>>
>>USE your_table_name IN 0 ALIAS PARENTS
>>USE your_table_name AGAIN IN 0 ALIAS CHILDS
>>* select all childs from top record
>>GO TOP
>>SELECT Tname FROM CHILDS INTO CURSOR cRelations WHERE childs.pid=parents.id
>>BROWSE nowait
>>
>
>There is no need to open table twice, you could self-join the table:
>
>SELECT ....;
> FROM TableName Master;
>JOIN TableName Child ON childs.pid=parents.id;
>INTO CURSOR crsTest
>
Hi, Borislav!
Yes, we can use and self-join, but your syntax must be changed
when we want to select just one field
otherwise you will get an error about non-unique field name.
And question was about selection one field under specific condition,
so I think that using one table under two different aliases
is more simple.
WBR,
Juri