Oracle字符串行拆分成列的三种方式 --muphy 开发过程中经常会遇到将前台多个值用逗号连接一同传递到后台查询,这个用逗号连接的字符串分隔的每个字符串分别对应Oracle数据库表的不同行. 如下一个表table_test的内容如下: name value pa 5 pb 6 pc 8 需要查询分别与pa和pb相同的行,参数字符串为: pi_names=”pa,pb” 如何查询呢,有以下三种方式(根据执行计划分析,效率由…
时间范围分区拆分create table emp (id number(6) not null,hire_date date not null)partition by range(hire_date)(partition p_1998 values less than (to_date('1998-12-31','YYYY-MM-DD')),partition p_1999 values less than (to_date('1999-12-31','YYYY-MM-DD')),partit…
使用oracle提供的regexp_substr()函数,对将IPV4地址分成4段: select v.ip as ip_address, regexp_substr(v.ip,,) as A, regexp_substr(v.ip,,) as B, regexp_substr(v.ip,,) as C, regexp_substr(v.ip,,) as D from (select '192.168.253.183' as ip from dual) v 结果如下: -------------…