update 表 set 字段 = Replace(字段 ,“.SZ”,“”) from 表 where substring(字段,1,1) = "0"
-- 1.把所有以0开头的6位数字的记录后面加上“.SZ”,如“000001”变为“000001.SZ”; update [表名] set [代码]=[代码]+'.SZ' where left([代码],1)='0' and len([代码])=6-- 2.把所有以6开头的6位数字的记录后面加上“.SH”,如“600898”变为“600898.SH”. update [表名] set [代码]=[代码]+'.SH' where left([代码],1)='6' and len([代码])=6
-- 1.把所有以0开头的6位数字的记录后面加上“.SZ”,如“000001”变为“000001.SZ”; update [表名] set [代码]=[代码]+'.SZ' where left([代码],1)='0' and len([代码])=6
-- 2.把所有以6开头的6位数字的记录后面加上“.SH”,如“600898”变为“600898.SH”. update [表名] set [代码]=[代码]+'.SH' where left([代码],1)='6' and len([代码])=6
-- 1.把所有以0开头的6位数字的记录后面加上“.SZ”,如“000001”变为“000001.SZ”;
update [表名]
set [代码]=[代码]+'.SZ'
where left([代码],1)='0' and len([代码])=6-- 2.把所有以6开头的6位数字的记录后面加上“.SH”,如“600898”变为“600898.SH”.
update [表名]
set [代码]=[代码]+'.SH'
where left([代码],1)='6' and len([代码])=6
update [表名]
set [代码]=[代码]+'.SZ'
where left([代码],1)='0' and len([代码])=6
-- 2.把所有以6开头的6位数字的记录后面加上“.SH”,如“600898”变为“600898.SH”.
update [表名]
set [代码]=[代码]+'.SH'
where left([代码],1)='6' and len([代码])=6