3
我有一個客戶的名和姓用空格分隔的列。我會寫什麼代碼來解析他們兩個?我試過這個,但它不起作用。拆分姓氏和名字Netezza
SELECT LEFT (CUSTOMER_NAME, CHARINDEX(' ', CUSTOMER_NAME)) as CUST_1ST_1_NM,
substring(CUSTOMER_NAME, CHARINDEX(' ', CUSTOMER_NAME)+1, len(CUSTOMER_NAME)-(CHARINDEX(' ', CUSTOMER_NAME)-1)) as CUST_LAST_1_NM
from CUSTOMER_TABLE
謝謝!
使用的UDF這樣的幫助偉大的工作,謝謝! – Drew