create table x1 as select cod_cia, cod_cliente, estado from gen_cliente where translate(cod_cliente, 'z0123456789', 'z') is not null; insert into cambiocliente (COD_CIA,COD_CLIENTE,COD_NUEVO) select cod_cia, cod_cliente, cod_cliente from gen_cliente where translate(cod_cliente, 'z0123456789', 'z') is not null; select count(*) from gen_cliente where translate(cod_cliente, 'z0123456789', 'z') is not null; update cambiocliente set cod_nuevo=translate(cod_cliente, '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ+.', '0123456789'); select cod_cliente, cod_nuevo from cambiocliente where translate(cod_nuevo, 'z0123456789', 'z') is not null; select count(distinct cod_nuevo) from cambiocliente; select cod_nuevo, count(*) from cambiocliente group by cod_nuevo having count(*)>1; select cod_cliente, cod_nuevo from cambiocliente c where exists (select 1 from gen_cliente m where m.cod_cia=c.cod_cia and m.cod_cliente=c.cod_nuevo); select cod_cliente, cod_nuevo from cambiocliente c where c.cod_nuevo='025009168001999'; COD_CLIENTE COD_NUEVO ------------------------- ---------------- 135RE079801001999 135079801001999 8060830. 8060830 del 1775417. 1775417 del 025RE00916+8001999 025009168001999 del 025RE009168001999 025009168001999