当前位置: 动力学知识库 > 问答 > 编程问答 >

Grabbing some part of string using SQL Server 2012

问题描述:

This question already has an answer here:

  • How to find sub-string and replace it?

    5 answers

网友答案:

Barring additional information it's impossible to know if the following is adequate, but it works for your sample data:

SELECT REPLACE([Column-2],'- x','- ZZ x')
FROM YourTable
网友答案:

Using STUFF:

SELECT STUFF([Column-2],CHARINDEX('-',[Column-2]) + 1,1,' ZZ ') FROM [table_name]
分享给朋友:
您可能感兴趣的文章:
随机阅读: