update subinterface set ipdataid = null where ipdataid is not null and ipdataid not in(select innerip.ipdataid from ipdata innerip ); update subinterface set ipdatav6id = null where ipdatav6id is not null and ipdatav6id not in(select innerip.ipdataid from ip_data_v6 innerip ); update nodeinterface set ipdataid = null where ipdataid is not null and ipdataid not in(select innerip.ipdataid from ipdata innerip ); update nodeinterface set ipdatav6id = null where ipdatav6id is not null and ipdatav6id not in(select innerip.ipdataid from ip_data_v6 innerip );