📌  相关文章
📜  从 ms sql 代码示例中的字符串中获取第二个单词

📅  最后修改于: 2022-03-11 15:05:32.795000             🧑  作者: Mango

代码示例1
-- Example there is a column FULL_NAME which contains two words like "Bob Dylan"
-- To fetch second word "Dylan" we will use space as a divisor 
-- and take 10 signs after space
SELECT SUBSTRING(FULL_NAME, (SELECT CHARINDEX(' ', FULL_NAME)+1), 10) 
FROM TABLE_NAME;