I have a table as below. I want to write a query that displays the parent name and other child info for each child.
| ID | Name | ParentID |
|-----------|---------|------------|
| Parent1 | aaa | |
| Parent2 | bbb | |
| Child1 | ccc | Parent1 |
| Child2 | ddd | Parent1 |
| Parent3 | eee | |
I want to display the details as below:
| ID | Name | ParentID | ParentName |
|-----------|---------|------------|------------|
| Parent1 | aaa | | |
| Parent2 | bbb | | |
| Child1 | xxx | Parent1 | aaa |
| Child2 | yyy | Parent1 | aaa |
| Parent3 | ccc | | |