DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: SQL query

  1. #1
    Join Date
    Mar 2002
    Posts
    3
    hi

    We have a one table like emp

    emp-table


    empno mgr
    (pk) (fk of empno)
    1
    2 1
    3 2
    4 3
    5 4
    6 4
    .
    .
    .
    1234 1233
    .
    .
    n n-2
    We need a output like this

    1
    . 2
    .....3
    ***** 4
    ******* 5
    ********* 6
    ***********7
    ************8
    **************9

    ****************** 1233
    .
    .
    *************************n-1

    just like a hirarchial model.

    It resembles like Directory structure.


    thanks in advance
    anj

  2. #2
    Join Date
    Sep 2001
    Location
    NJ, USA
    Posts
    1,287
    Try:
    select rpad('*',pk_fld,'*')||ltrim(rtrim(to_char(fk_fld)) from emp_table;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width