How to extract multiple strings from single rows in SQL Server

前端 未结 3 1187
暖寄归人
暖寄归人 2020-12-19 23:01

I have e.g. the following table data:

id    |    text
--------------------------------------------------------------------------------
1     |  Peter (Peter@         


        
3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-19 23:33

    THe substring functions have starting position parameter. So you find the first occurrence,and start the next search (in your loop) at the occurrence position + occurenceLength. You'd need to write a function that returns the values either as a delimited string or table. Use the @-sign to find your way into the email address, and then scan backwards and forwards until you reach white space or a character that's invalid in an email address (or the start-pos or the beginning or the last char).

提交回复
热议问题