how to get parent and child records in single query using sql code example
Example: 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;