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

4

1 に答える 1

2
update t
set sort[2] = 1
where sort[1:2] = array[0,0]
于 2012-10-22T16:59:07.877 に答える