Update int array based on parent
- by Pickels
I have the following int[] in my database:
'{0}'
'{0,0}'
'{0,0,0}'
'{0,0,0,0}'
This column is used to sort my tree data. Now when a parent updates it's order the children should also update. For example if the second record updates it's order to 1 it should result in the following.
'{0}'
'{0,1}'
'{0,1,0}'
'{0,1,0,0}'
So I was wondering what the query would be to update record 3 and 4. In case it's not clear what I am asking leave a comment I can add additional information.
Screenshot of my actual data: