现在我有个user_test表,里面有个test_id字段,有个唯一字段user_id,现在想将test_id为0的记录置为一个序列值,假如我这个表记录有好几百万条,但我每次只想置1w条,有什么好的办法吗?执行的sql最好效率要高能走索引,因为数据量比较大
UPDATE user_test set test_id = nextval('user_test_id_seq') where test_id =0;
现在想实现的功能 :UPDATE user_test set test_id = nextval('user_test_id_seq') where test_id =0 limit 10000; 此段sql会报错