因?yàn)樽x寫的關(guān)系有些主子表不適合做級(jí)聯(lián)刪除,所以可以通過(guò)手工方式清除數(shù)據(jù)氮唯,或者寫在觸發(fā)器中,當(dāng)刪除主表時(shí)拙寡,同時(shí)刪除子表無(wú)效數(shù)據(jù)琳水。
-- 刪除多余子表數(shù)據(jù)
delete from KPI_STANDARD where pk_performance_b not in (select pk_performance_b from kpi_b )
delete from KPI_GET_VALUE where pk_performance_b not in (select pk_performance_b from kpi_b )