--以下两条语句,将summary按-分解为两段字符串
regexp_substr(summary, '[^\-]+', 1, 1) as _work
regexp_substr(summary, '[^\-]+', 1, 2) as _home
--查询语句
select
summary,
regexp_substr(summary, '[^\-]+', 1, 1) as _work,
regexp_substr(summary, '[^\-]+', 1, 2) as _home
from
hw_ehr_personinfo_t
[list]
[*]下面是查询出的结果
[*][table]
|summary|_work|_home|
|上海-安徽|上海|安徽|
|河北-广东|河北|广东|
[/table]
[/list]
--日期转换函数,24小时制
to_date(t1_join_date, 'yyyy/mm/dd hh24:mi:ss')
--格式化日期到字符串
to_char(t1_join_date, 'yyyy/mm/dd hh24:mi:ss')