postgresql sql批量更新记录
时间:2021-07-27 08:19:50|栏目:|点击: 次
复制代码 代码如下:
CREATE FUNCTION updateTchrNm() RETURNS void AS
$body$
DECLARE
rownum integer := 1;
BEGIN
while rownum <= 1000 LOOP
update t_tchr set tchr_nm = '田中?圩?' || rownum, tchr_knm = 'タナカアイコ' || rownum, tchr_anm = 'tanaka' || rownum where tchr_cd = 'TCHR' || (1000000 + rownum);
rownum := rownum + 1;
END LOOP;
return;
END;
$body$ LANGUAGE 'plpgsql';
select updateTchrNm();
栏 目:
下一篇:docker 容器上编译 go 程序提示找不到文件问题
本文标题:postgresql sql批量更新记录
本文地址:http://www.codeinn.net/misctech/161961.html






