
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

from child
left join parent
    on child.from_field = parent.to_field

where parent.to_field is null


