update 表 set 字段=stuff(字段,patindex('%[1-9][0-9][0-9][0-9][0-9][0-9]%',@s),6,'')
update 表名set 邮政编码=''
不知道 等高手if exists (select * from sysobjects where name='aaaa') drop table aaaa create table aaaa (inf char(200),city char(200)) insert into aaaa select ',,北京,200001,,','北京'update aaaa set inf= case when inf like '%北京%'+'%[1-9][0-9][0-9][0-9][0-9][0-9]%' or inf like '%[1-9][0-9][0-9][0-9][0-9][0-9]%'+'%北京%' then '北京' end drop table aaaa
set @s='北京,100001'
select stuff(@s,patindex('%[1-9][0-9][0-9][0-9][0-9][0-9]%',@s),6,'')/*
北京,(所影响的行数为 1 行)
*/
drop table aaaa
create table aaaa
(inf char(200),city char(200))
insert into aaaa
select ',,北京,200001,,','北京'update aaaa
set inf= case when inf like '%北京%'+'%[1-9][0-9][0-9][0-9][0-9][0-9]%' or inf like '%[1-9][0-9][0-9][0-9][0-9][0-9]%'+'%北京%'
then '北京' end drop table aaaa