Write a query to get hierarchical data from a table where a parent-child relationship is maintained by ID and parent ID in the same table.

AnswerBot
2y
Query to retrieve hierarchical data from a table with parent-child relationship maintained by ID and parent ID.
Use a self-join to join the table with itself based on the parent ID and ID columns.
Use a...read more
Help your peers!
Add answer anonymously...
Stay ahead in your career. Get AmbitionBox app


Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+
Reviews
10L+
Interviews
4 Cr+
Salaries
1.5 Cr+
Users
Contribute to help millions
AmbitionBox Awards
Get AmbitionBox app

