select t.ip_addr,t.float_ip_addr from cmdb_host t where t.float_ip_addr like '%t.ip_addr%'
这个是 我想的,,居然是当做字符串来处理,居然之前没用过 这种 表内直接 like 的 写法。
   select t.ip_addr, t.float_ip_addr, p.soft_login_ip
     from cmdb_host t, cmdb_program p
    where p.host_search_code = t.cuid
      and REGEXP_LIKE(t.ip_addr, p.soft_login_ip) or REGEXP_LIKE(t.float_ip_addr,p.soft_login_ip)
这种写法 也很慢,执行了22秒之多
下面是 数据,我要的结果是 第三列不再第一列和第二列中 中存在,not like,,
高手指点,,最好给点 原理什么的。。
1 10.46.0.50/51 10.46.0.102/10.46.0.104/10.46.0.106/10.46.0.109/10.46.0.114 10.46.0.50
2 10.46.0.50/51 10.46.0.102/10.46.0.104/10.46.0.106/10.46.0.109/10.46.0.114 10.46.0.50
3 10.46.0.50/51 10.46.0.102/10.46.0.104/10.46.0.106/10.46.0.109/10.46.0.114 10.46.0.50
4 10.46.0.50/51 10.46.0.102/10.46.0.104/10.46.0.106/10.46.0.109/10.46.0.114 10.46.0.50
5 10.46.0.50/51 10.46.0.102/10.46.0.104/10.46.0.106/10.46.0.109/10.46.0.114 10.46.0.50
6 10.46.0.50/51 10.46.0.102/10.46.0.104/10.46.0.106/10.46.0.109/10.46.0.114 10.46.0.50
7 10.46.0.50/51 10.46.0.102/10.46.0.104/10.46.0.106/10.46.0.109/10.46.0.114 10.46.0.50
8 10.46.0.50/51 10.46.0.102/10.46.0.104/10.46.0.106/10.46.0.109/10.46.0.114 10.46.0.50
9 10.46.0.50/51 10.46.0.102/10.46.0.104/10.46.0.106/10.46.0.109/10.46.0.114 10.46.0.50
10 10.46.0.50/51 10.46.0.102/10.46.0.104/10.46.0.106/10.46.0.109/10.46.0.114 10.46.0.50
11 10.46.0.50/51 10.46.0.102/10.46.0.104/10.46.0.106/10.46.0.109/10.46.0.114 10.46.0.50