Table hierachy using sql query

  • Hi,

    Here i have a table hirarchy as follows

    T1

    |

    / \

    T2 T3

    / /\ \

    T4 T5 T6 T7

    /

    T8

    Can we represent the above table dependency as follows?? The columns has to be dynamically added in the output and a astrick symbol has be added/appended depending on level.

    Meaning depending on the level, that many astricks to be added.

    I need to supply the Tablename to a stored procedure and should display something as follows

    *T1**T2 ***T4 ****T8

    *T1 **T3 ***T5 NULL

    *T1 **T3 ***T6 NULL

    *T1 **T3 ***T7 NULL

    can we do like this ????????

  • this caught my eye, i've done a lot of stuff with following foreign key chains;

    how would you expect the table T2 to be displayed? it has two children inder it...would they be ont he same line, but with two asterisks?

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Am not sure, how it is going to be implemented. But this is what i meant from the first row .

    *T1**T2 ***T4 ****T8

    Meaning, under T1 there is a table T2 and under T2 there's a table T4 and under T4 there's are child table T8.

    Is there any other way, through which i can easily know the dependency tree???

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply