Question : Hierarchy Tree Query

Listed below is a query that displays a hierarchy tree in Oracle. What is the syntax to do this same query in MSSQL(T-SQL)?

Oracle Hierarchy Query:
select id, sys_connect_by_path(description,' > ')tree,cat_level
from ticket_category_tmp
start with parent_cat_code=0
connect by prior id=parent_cat_code
Order By tree


Results From Query:
ID     TREE                                                                   CAT LEVEL
7      > Administration                                                        0
115      > Administration > Authorizations                            1
116      > Administration > Authorizations > Changeout         2
117      > Administration > Authorizations > Trip                   2
114      > Administration > Password Change                       1
113      > Administration > UserID Change                            1

Answer : Hierarchy Tree Query

>Invalid column name 'parent_cat_code'.

what is the structure of your table ticket_category_tmp does this column exists there please post the schema for this table.
Random Solutions  
 
programming4us programming4us