merge into wfm_nf.NF_PM_NETWORK_MIGRATION_WKS d
using (SELECT pca.parent_nf_id nf_id,
--, pca.parent_nf_id, pca.associated_nf_id ,pca.lvl
facno.nf_id facno_nfid,
facno.pm_status facn_pm_status,
rank() over (partition by pca.parent\_nf\_id
order by pca.lvl, facno.pm\_status desc) as rank
FROM wfm\_nf.nf\_pm\_ien\_parent\_child\_associations pca
LEFT JOIN wfm\_nf.NF\_PM\_IEN\_FACNO facno
ON facno.nf_id = pca.ASSOCIATED_NF_ID
WHERE facno.pm_status IS NOT NULL) s
on (d.nf\_id = s.nf\_id and s.rank=1) when matched then update set d.facn\_pm\_status = s.facn\_pm\_status ;
This merge statement through error --ORA-30926: unable to get a stable set of rows in the source tables