this is my table with ParentId column. now i want make parent and child in this given table using self join.
I searched on internet but these is not good solution.I am using this table in Entity Framwork
My Table
___________________________
ID Title ParentId
| 31 | Retial | NULL |
| 32 | Mortgogages | 31 |
| 34 | UK Mortgages | 32 |
| 35 | Buy To Let | 32 |
| 36 | Credit Card | 31 |
| 37 | Corporate | NULL |
Output
e.g
31 has 0 child
32 has 2 child
32 has 0 child


Vishal JadavRank #1,691 · 901 reputationPosted Aug 5, 2016, 3:45 AM EDT
Nitin SontakkeRank #264 · 9.6K reputationPosted Aug 5, 2016, 3:46 AM EDT
Gagan Gautam152 reputationPosted Aug 5, 2016, 3:51 AM EDT
HIVishal Jadav
Gagan Gautam152 reputationPosted Aug 5, 2016, 3:58 AM EDT
HiNitin Sontakke
Vishal JadavRank #1,691 · 901 reputationPosted Aug 5, 2016, 3:58 AM EDT
Nitin SontakkeRank #264 · 9.6K reputationPosted Aug 6, 2016, 10:31 PM EDT