SQL query construction - separate data in a column into two columns

后端 未结 4 921
北恋
北恋 2021-01-25 08:30

I have a column that contains links. The problem is that the titles of the links are in the same column, so it looks like this:
linktitle|-|linkurl
I want l

4条回答
  •  [愿得一人]
    2021-01-25 08:33

    SELECT substring(field_name, 1, locate('|-|', field_name)-1) as title,
    substring(field_name, locate('|-|', field_name)+3) as linkurl
    

提交回复
热议问题