I have table with records like this tried using CTE but very noob in DB related stuff and browsed through couple of articles similar to this but most of them are talking about getting list of parents not children.
ID Parent ID Ultimate record
1 -- Yes
2 1 No
3 1 No
4 2 No
5 2 No
6 1 No
Expected result
ID Child Level
1 2 1
1 3 1
1 4 2
1 5 2
1 6 3
2 4 1
2 5 1
2 6 2
5 6 1