SQL Server replace, remove all after certain character

前端 未结 6 1098
粉色の甜心
粉色の甜心 2020-11-27 16:13

My data looks like

ID    MyText
1     some text; some more text
2     text again; even more text

How can I update MyText to drop everything

6条回答
  •  情深已故
    2020-11-27 16:48

    Use CHARINDEX to find the ";". Then use SUBSTRING to just return the part before the ";".

提交回复
热议问题