当在做测试或者需求就是需要更新10条数据中的第二行到第八行的数据,那应该这么办?开始的时候我也是百思不得其解,也就是知道了ctid用法才解决了类似的问题。
下面就直接说一下例子,
一个简单的表mytest7,
"ctid"
"id"
"name_1"
"name_2"
"name_3"
"(0,1)"
"1"
"name_11"
"name_21"
"name_31"
"(0,2)"
"2"
"name_12"
"name_22"
"name_32"
"(0,3)"
"3"
"name_13"
"name_23"
"name_33"
"(0,4)"