PostgreSQL: skip selecting row if found more than one row with similar column value
I have the following selection: SELECT posm.id AS org_scope_metric_id, cc.code AS control_code, ccp.code AS part_code, pop.id AS program_id FROM public.org_scope_metric posm JOIN public.org_metric pom ON pom.id = posm.metric_id JOIN compliance.metric cm ON cm.id = pom.metric_id JOIN compliance.control_part_metric ccpm ON ccpm.metric_id…