【发布时间】:2015-02-02 10:59:48
【问题描述】:
我从表 John Doe 得到这个。
将 this 拆分为两个变量 this 的最佳方法是什么:
lastName = 'Doe';
firstName = 'John';
【问题讨论】:
我从表 John Doe 得到这个。
将 this 拆分为两个变量 this 的最佳方法是什么:
lastName = 'Doe';
firstName = 'John';
【问题讨论】:
我想这应该可行:
SELECT SUBSTR(NameColumn, 1, INSTR(NameColumn,' ',1)) AS firstName,
SUBSTR(NameColumn, INSTR(NameColumn,' ',1)+1) FROM tablName
【讨论】: