oracle 建账号在oracle中使用正则表达式截取字符串

在oracle中使用正则表达式截取字符串

 

Sql代码  

–以下两条语句,将summary按-分解为两段字符串  

regexp_substr(summary, '[^\-]+', 1, 1) as _work  

regexp_substr(summary, &#oracle账号39;[^\-]+', 1, 2) as _home  

–查询语句  

select      

    summary,  

    regexp_substr(summary, '[^\-]+', 1, 1) as _work,  

    regexp_substr(summary, '[^\-]+', 1, 2) as _home  

from   -www.2cto.com-
    hw_ehr_personinfo_t  

 

下面是查询出的结果

summary _work _home

上海-安徽 上海 安徽

河北-广东 河北 广东

 

Sql代码  

–日期转换函数,24小时制  

to_date(t1_join_date, 'yyyy/mm/dd hh24:mi:ss')  

–格式化日期到字符串  

to_char(t1_join_date, 'yyyy/mm/dd hh24:mi:ss')  

 

 

 

 

作者 言日星极

此条目发表在oracle metalink账号分类目录,贴了标签。将固定链接加入收藏夹。