The below query is returning data as expected but we have a requirement that where there is level 1, it should be the last level and last level should be represented as 1st.