>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
SELECT * FROM sometable ORDER BY sid
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only