How to split the name string in mysql?

后端 未结 16 1947
轮回少年
轮回少年 2020-11-22 11:44

How to split the name string in mysql ?

E.g.:

name
-----
Sachin ramesh tendulkar
Rahul dravid

Split the name like firstname

16条回答
  •  长情又很酷
    2020-11-22 12:10

    You could use the common_schema and use the tokenize function. For more information about this, follow the links. Your code the would end up like:

    call tokenize(name, ' ');

    However, be aware that a space is not a reliable separator for first and last name. E.g. In Spain it is common to have two last names.

提交回复
热议问题