用了种比较丑都方式修改的,幸苦数组不太长
-- select array_upper(adv_ids,1) from deeplinks
update deeplinks set adv_ids[1] = adv_ids[1] + 100 where array_upper(adv_ids,1) >= 1;
update deeplinks set adv_ids[2] = adv_ids[2] + 100 where array_upper(adv_ids,1) >= 2;
update deeplinks set adv_ids[3] = adv_ids[3] + 100 where array_upper(adv_ids,1) >= 3;
update deeplinks set adv_ids[4] = adv_ids[4] + 100 where array_upper(adv_ids,1) >= 4;
update deeplinks set adv_ids[5] = adv_ids[5] + 100 where array_upper(adv_ids,1) >= 5;
update deeplinks set adv_ids[6] = adv_ids[6] + 100 where array_upper(adv_ids,1) >= 6;
1
lekai63 2020-12-17 12:21:14 +08:00
我记得 postgres 中是可以对字段自定义步长的
|