seems like what you need is thisTRUNCATE TABLE GISLOADER.CTY_FC_VACANCYINSERT GISLOADER.CTY_FC_VACANCY (WIS_ID, OBJECTID, CHILDCOUNT,MAX_CHILD)SELECT m.WIS_ID,m.OBJECTID,m.CHILDCOUNT,n.MAX_CHILDFROM(SELECT GISLOADER.CTY_FC_PROVIDERSRELATE.WIS_ID AS WIS_ID,max(GISLOADER.CTY_FC_PROVIDERSRELATE.OBJECTID) AS OBJECTID,COUNT(GISLOADER.CTY_FC_PROVIDERSRELATE.WIS_ID) AS CHILDCOUNTFROM GISLOADER.CTY_FC_PROVIDERSRELATEGROUP BY GISLOADER.CTY_FC_PROVIDERSRELATE.WIS_ID)mJOIN (select DISTINCT GISLOADER.CTY_FC_VACANCY.WIS_ID,GISLOADER.CTY_FC_PROVIDERS.MAXCHILDREN as MAX_CHILDFROM GISLOADER.CTY_FC_PROVIDERS JOIN GISLOADER.CTY_FC_VACANCYON (GISLOADER.CTY_FC_PROVIDERS.WIS_ID_ = GISLOADER.CTY_FC_VACANCY.WIS_ID))nON n.WIS_ID=m.WIS_ID