不要第5位吗?declare @table table(aa varchar(20))insert @tableselect '2207-001231'unionselect '2007-0045672'unionselect '2007-001234'unionselect '2007-0123445'unionselect '2008-0021446'unionselect '2007789456'select * from @tableupdate @table set aa='2007-0'+left(replace(aa,'2007-00',''),4)where aa like '2007-00%'select * from @table如果要第五位就把+left(replace(aa,'2007-00',''),4)中的4改为5 |