怎样用SQL语句把IP地址“192.168.1.118”中的各段取出来?
以下是分拆字符常用的SQL语句:
select regexp_substr(ip,'[^.]+',1,1) a,
regexp_substr(ip,'[^.]+',1,2) b,
regexp_substr(ip,'[^.]+',1,3) c,
regexp_substr(ip,'[^.]+',1,4) d
from (select '192.168.1.118' as ip from dual);
A B C D
----- ----- ----- -----
192 168 1 118