2

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:

Screenshot of my actual data

1 Answer 1

2
update t
set sort[2] = 1
where sort[1:2] = array[0,0]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.