--Order 20013066.80

ALTER TABLE CLIENT
	ADD (ADMINNUMBER VARCHAR2(20) NULL);

update client cl
   set cl.adminnumber = (select clr.adminnumber
                           from clientresident clr
                          where clr.client_id = cl.client_id
                            and adminnumber is not null)
 where cl.client_id in
       (select cl2.client_id
          from client cl2, clientresident clr2
         where clr2.client_id = cl2.client_id
           and cl2.adminnumber is null
           and clr2.adminnumber is not null);
commit;

ALTER TABLE CLIENTRESIDENT
RENAME COLUMN ADMINNUMBER TO ADMINNUMBER_OLD;