mysql - Replace last string in IP-address accornding to specific condition in PL/SQL -
i've got table fields , values:
entaddr (varchar2) entifindex (varchar2) 18.17.16.2 1 18.17.16.53 2 18.17.16.1 3 18.17.16.54 4
i have join 1st , 3rd record knowing 1st entaddr. how can 18.17.16.1 18.17.16.2? (last char -1). have join 2nd , 4th record knowing 2nd entaddr (18.17.16.54 18.17.16.53, i.e last char +1)
so need "select" like:
select
entifindex table1
'some transformation of entaddr (changing last char) '= entaddr
thanks in advice!!
is looking @
sql> select concat (substr('18.17.16.2',1,9),substr ('18.17.16.2',-1)-1 ) "concat val" dual; concat val ---------- 18.17.16.1