SELECT
persondeath.pid,
person.idcard,
persondeath.cdeatha,
persondeath.deadcause,
persondeath.deaddate,
persondeath.dateupdate,
persondeath.deadplace,
persondeath.hospdeath
FROM
persondeath
INNER JOIN person ON persondeath.pcucodeperson = person.pcucodeperson
AND persondeath.pid = person.pid
where persondeath.cdeatha is null
or persondeath.deadcause is null
or deaddate is null
or deadplace is null
or (deadplace=1 and hospdeath is null) or persondeath.dateupdate is null;