Moin,
ein
PHP-Code:
update datei a set (f1f2f3) = (
    
select f1f2F3 
     from datei b 
   where a
.feld b.feld and b.xxx=and b.datum = (
                   
select max(c.datum
                    
from datei c
                  where c
.yyy = :wert and ...                  ) 
       and ...                             ) 
where a.f1=' ' and a.f2 ' ' and a.f3 ' ' and ... 
bricht ab und zu ab, weil es keine passenden Werte in Datei b gibt.

Wenn ich
PHP-Code:
update datei a set (f1f2f3) = (
    
select coalesce(f1f2F3 
     from datei b 
   where a
.feld b.feld and b.xxx=and b.datum = (
                   
select max(c.datum 
                    from datei c
                  where c
.yyy = :wert and ...                   ) 
      and ...  , 
' '' '' '))      
where a.f1=' ' and a.f2 ' ' and a.f3 ' ' and ... 
davon mache, ist die Syntax falsch.

muß ich das "and exists..." mit dem ganzen Gerödel machen oder gibt es eine Syntax die
mit dem coalesce funktioniert?

Danke
der ILEMax