Вот один вариант, который показывает, как извлечь почтовый индекс из адресной строки - используя регулярные выражения, возьмите последнее слово :
SQL> with addr (addr) as
2 -- this is the "address column"
3 (select 'Muppet street,London,England,12345' from dual)
4 select regexp_substr(addr, '\w+$') zipcode
5 from addr;
ZIPCO
-----
12345
SQL>
[РЕДАКТИРОВАТЬ: вставить почтовые индексы в другую таблицу]
Вот как.
SQL> -- Table that contains addresses
SQL> create table t1 (addr varchar2(50));
Table created.
SQL> insert into t1
2 select 'Muppet street,London,England,12345' from dual union all
3 select 'Batman road,Berlin,Germany,9948' from dual union all
4 select 'Ilica,Zagreb,Croatia,10000' from dual;
3 rows created.
SQL> -- A new table, containing ZIP codes
SQL> create table t2 (zipcode number);
Table created.
SQL> -- Insert zip codes from the address into the new table
SQL> insert into t2 (zipcode)
2 select regexp_substr(t1.addr, '\w+$')
3 from t1;
3 rows created.
SQL> select * From t2;
ZIPCODE
----------
12345
9948
10000
SQL>