September 16, 2021 at 8:15 am
My German is not good enough to understand all of your screenshots, and as you have not provided any usable sample code, I cannot provide a coded solution. But I can offer some general advice about how I would structure this.
If I make the following assumptions:
WITH src as (SELECT Id, Value etc) --this is the subquery part
UPDATE trg
SET Value = src.Value
FROM Target trg
JOIN src on trg.Id = src.Id
If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.
September 16, 2021 at 1:25 pm
Vielleicht sowas
with upd_cte(SUM_KBABenoetigteZeit, pm_extended_id) as (
select sum(TCompl.usr_KBABenoetigteZeit), PMProc.pm_extended_id
from rm_task_completion TCompl
join rm_request_task AS RTask ON TCompl.rm_task_guid = RTask.pm_guid
join rm_request AS REQ ON RTask.rm_request_guid = REQ.pm_guid
join pm_process AS PMProc ON REQ.pm_guid = PMPROC.pm_guid
where TCompl.rm_task_guid = RTask.pm_guid
group by PMProc.pm_extended_id)
update REQ
set usr_kbagesamtzeittask = isnull(SUM_KBABenoetigteZeit, 0)
from rm_request as REQ
left join upd_cte u on REQ.pm_guid=u.pm_extended_id
Where REQ.usr_kbagesamtzeittask is NULL
or REQ.usr_kbagesamtzeittask = 0;
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply