select fu.*

from (select distinct nqe."FileUploadId" as "FUID"

        from (select * from "QsEintrag" where "ErfolgsannahmeErreicht" is not null and "FileUploadId" is not null) nqe

          left outer join "FileUpload" fu on fu."Id"=nqe."FileUploadId") fi

  left outer join "FileUpload" fu on fu."Id"=fi."FUID"