user3601725
user3601725

Reputation: 515

Remove one parent record which has two parents records

I have a table which ended up with ParentIDs incorrectly created so that some records are on the same levels as ones which their parent record. For simplicity sake:

Name Parent
Son Father
Grandson Son
Grandson Father

I'm trying to use Inner Joins to remove records where the Name has a Parent which it shares a Parent name with in another record to get rid of the latter.

https://sqlfiddle.com/mysql/online-compiler?id=19f9aa92-6868-4eb0-8432-ce2b92e60c3a&id=a907fe56-449c-4de1-be40-bd485788a3a7&id=e3973f4e-fcde-4dc4-b5cf-f576e13066df&id=561d3dba-6f07-467f-8908-2245e3733bd0

Upvotes: 0

Views: 14

Answers (0)

Related Questions