How to select part of the string with T-SQL?
I have a string comma delimited. I need to select with t-sql just first part of it.
Example
table
id items values
1 item, item2, item3, item4 5
I need to get result like
ID Items 开发者_StackOverflow社区 Values
1 item 5
Try this one
select id,
substring(items,0,charindex(',',items)),
values
from mytable
精彩评论