ORACLE分解IP地址
来源:互联网 发布:iphone怎么传文件到mac 编辑:程序博客网 时间:2024/04/26 00:37
通过使用内置函数substr和instr来分解IP地址。看个下面的例子。
SQL> col a format a10
SQL> col b format a10
SQL> col c format a10
SQL> col d format a10
SQL> select ip,
2 substr(ip,1,instr(ip,'.',1,1)-1) a,
3 substr(ip,instr(ip,'.',1,1)+1,instr(ip,'.',1,2)-instr(ip,'.',1,1)-1) b,
4 substr(ip,instr(ip,'.',1,2)+1,instr(ip,'.',1,3)-instr(ip,'.',1,2)-1) c,
5 substr(ip,instr(ip,'.',1,3)+1) d
6 from
7 (select '192.168.1.1' as ip from t1);
IP A B C D
----------- ---------- ---------- ---------- ----------
192.168.1.1 192 168 1 1
再换一个IP来试试
SQL> select ip,
2 substr(ip,1,instr(ip,'.',1,1)-1) a,
3 substr(ip,instr(ip,'.',1,1)+1,instr(ip,'.',1,2)-instr(ip,'.',1,1)-1) b,
4 substr(ip,instr(ip,'.',1,2)+1,instr(ip,'.',1,3)-instr(ip,'.',1,2)-1) c,
5 substr(ip,instr(ip,'.',1,3)+1) d
6 from
7 (select '192.168.99.198' as ip from t1);
IP A B C D
-------------- ---------- ---------- ---------- ----------
192.168.99.198 192 168 99 198
呵呵 还挺通用的哦
- ORACLE分解IP地址
- Oracle修改IP地址
- oracle IP地址限制
- ORACLE得到用户IP地址
- Oracle RAC 修改 IP 地址
- Oracle RAC 修改 IP 地址
- Oracle RAC 修改 IP 地址
- ORACLE rac 改变IP地址
- Oracle RAC 修改 IP 地址
- Oracle RAC 修改 IP 地址
- Oracle修改监听IP地址
- Oracle RAC 修改 IP 地址
- Oracle EBS修改IP地址
- Oracle修改监听IP地址
- sql server中的IP 地址验证与分解
- Oracle里IP地址的取得
- Oracle RAC 修改 IP 地址& 修改主机名
- Ip地址排序(Oracle下)
- 为Select设置查询蚕食
- 程序员逛银饰店笑话一则(关注一下你周围可爱的程序员)
- 111001011011111110000011111001101000001110000101
- 浏览器缓存内幕与getLastModified方法
- lucene pdf+doc+ppt+xls+txt+多层文件
- ORACLE分解IP地址
- Lucene索引前对doc pdf html文件的预处理
- Visual Studio 2008 Intellisense for Extjs3.0
- 稳定,彷徨
- 线性常系数差分方程的Matlab递推求解
- 继续摘抄:时髦不能动
- 各种数据库分页查询Sql汇总
- excel与java报表开发
- 2009-12-06