---
title: "把db2中的主键值后几位替换掉"
author: "haofenglemon"
date: "2010-12-31T12:50:25Z"
tags: ["DB2"]
categories: ["数据库"]
slug: "db2"
draft: true
lastmod: "2010-12-31T12:50:25Z"
id: 856755
url: "https://haofenglemon.iteye.com/blog/856755"
---

update table set mainid=substr(id，1，M)||‘000’ where dept=‘’；