select 1
where not exists (
select 1
from ourpension.load_snv l
where l.file_id = :fileId
and not exists (
select 1
from ourpension.contract ct
join ourpension.individual i on i.id = ct.individual_id
where ct.number = l.contract_number
and i.first_name = l.person_first_name
)
)
select 1
where not exists (
select 1
from ourpension.load_snv l
where l.file_id = :fileId
and not exists (
select 1
from ourpension.contract ct
join ourpension.individual i on i.id = ct.individual_id
where ct.number = l.contract_number
and i.middle_name = l.person_middle_name
)
)