Code: Select all
id title weightCode: Select all
id title weight
1 Colonel 1
3 Major 2
6 Sergeant 3
7 Private 4title: "Corporal "
weight: 4
The table would then look like this?
Code: Select all
id title weight
1 Colonel 1
3 Major 2
6 Sergeant 3
8 Corporal 4
7 Private 4With Corporal and Private having the same weight. Is there an easy to insert after "x" and bump every weight up by one below the new insertion? Or do I have to do the insertion, then make a loop - looping through all the elements below x and 'manually' increase each weight?