📌  相关文章
📜  在sql代码示例中拆分名字和姓氏

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

代码示例1
# Name of table = names_table
# Name of column containing names = full_name
# Simply change the table and column name to what corresponds with your dataset

SELECT LEFT(full_name, STRPOS(primary_poc, ' ') -1 ) AS first_name,  
          RIGHT(full_name, LENGTH(primary_poc) - STRPOS(primary_poc, ' ')) AS last_name, name
FROM names_table;

# NB: This does not capture middle names