I have a table called Module.
The table structure some things like:
ModuleID ModuleName ParentID
1 System Manage 0
2 Database Manage 1
3 Area Manage 1
4 Basic Setting 0
I would like to get the results below by a sql statement.
ModuleID ModuleName ParentMoudle
1 System Manage 0
2 Database Manage System Manage
3 Area Manage System Manage
4 Basic Setting 0
I am a sql newbie .Thank you very much!
Parent child relationship can be achived by LEFT OUTER JOIN and querying same table.