Update main set main.field1 = ( if(staging.field1 isnull) then ---- else if(staging. field2 isnull) then ...
stackoverflow.com