Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何通过忽略值字段中的几个数字来更新列。 例如,我BKIH-10A在列中有值SECTION-ID。 我只想10A在那个领域,我怎样才能BKIH-从那个领域中删除。
BKIH-10A
SECTION-ID
10A
BKIH-
尝试这个 :-
Declare @SECTION_ID varchar(20) Set @SECTION_ID='BKIH-10A' Select substring(@SECTION_ID,charindex('-',@SECTION_ID)+1,len(@SECTION_ID)) Result 10A
我假设您想要符号中的字符 -
-
或者
如果您可以硬编码子字符串表达式中起始字符串的位置
substring(SECTION_ID,6,len(SECTION_ID)