Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SELECT Statement
Message
De
09/01/2001 05:58:50
 
 
À
08/01/2001 12:00:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00460633
Message ID:
00461061
Vues:
14
>Hi,
>
>If I have the following records in a table.
>SID Desc PID LX
>1....A....0....0
>3....B....1....1
>5....C....3....2
>7....D....5....3
>8....E....14...3
>14...F....3....2
>21...G....3....2
>22...H....21...3
>
>and I want to sort so the table looks like a tree structure
>
>SID Desc PID LX
>1....A....0....0
>3....B....1....1
>5....C....3....2
>7....D....5....3
>14...F....3....2
>8....E....14...3
>21...G....3....2
>22...H....21...3
>
>SID - Structure ID
>PID - Parent ID
>LX - Level in the tree
>
>Could this be done using a select statement? Any help or suggestion is appreciated.
>
>Thanks

How do YOU determine the final order ? How do you know that the 5th & 6th records are related to each other & so should be reordered (they could be separate branches of the tree with only single elements, so the first table could already be a valid tree) ? Would you expect the same result if the first table were in the following order :

SID Desc PID LX
22...H....21...3
21...G....3....2
8....E....14...3
14...F....3....2
7....D....5....3
5....C....3....2
3....B....1....1
1....A....0....0
Len Speed
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform