I am converting an Oracle SP into SQL in Oracle this SP builds a tree and I know in SQL it is called a level. Can someone please give me some guidance on how levels work and the syntax and is a level the best way to go for something like this?

Thanks in advance