Answers for "How to find parent child relationship in SQL"

SQL
0

how to get parent and child record in single query using sql

SELECT child.Id,
       child.Name,
       child.ParentId,
       parent.Name as ParentName
FROM your_table child
JOIN your_table parent ON child.ParentId = parent.id;
Posted by: Guest on May-09-2021

Code answers related to "How to find parent child relationship in SQL"

Code answers related to "SQL"

Browse Popular Code Answers by Language