如果數據都是這樣的規律,可以如下Create Table XX (YY Varchar(10)) Insert XX Select 'aaa01' Union All Select 'aaa02' Union All Select 'aaa03' Union All Select 'bbb01' Union All Select 'bbb02' Union All Select 'bbb03' Union All Select 'zzz01' Union All Select 'zzz02' Union All Select 'zzz03' GO Update XX Set YY=Stuff(YY,1,3,Left(YY,1))Select * From XX GO Drop Table XX --Result /* a01 a02 a03 b01 b02 b03 z01 z02 z03 */
(YY Varchar(10))
Insert XX Select 'aaa01'
Union All Select 'aaa02'
Union All Select 'aaa03'
Union All Select 'bbb01'
Union All Select 'bbb02'
Union All Select 'bbb03'
Union All Select 'zzz01'
Union All Select 'zzz02'
Union All Select 'zzz03'
GO
Update XX Set YY=Stuff(YY,1,3,Left(YY,1))Select * From XX
GO
Drop Table XX
--Result
/*
a01
a02
a03
b01
b02
b03
z01
z02
z03
*/