select
    us0.nr01 as nr01,
    us0.p01  as p01,
    us0.p100 as p100
from us0
LEFT JOIN d31 ON d31.nr01=us0.p410
LEFT JOIN d80 ON d80.nr01=us0.p412
WHERE us0.p410=0
  ||  d31.nr01 IS NULL
  ||  d80.p03<=-9999;
