分割字符到列DECLARE @a VARCHAR(10)SET @a ='00G-2-1102'SELECT CHARINDEX('-',@a,CHARINDEX('-',@a))SELECT CHARINDEX('-',@a,CHARINDEX('-',@a)+1) SELECT SUBSTRING(@a,CHARINDEX('-',@a)+1,(CHARINDEX('-',@a,CHARINDEX('-',@a)+1) - CHARINDEX('-',@a,CHARINDEX('-',@a)