Hello, SQL2008R2
I have an inner join that joins a one row table to a 10 row table. When I do a select it returns all ten rows:
However, I then try to do an update which only does one update:
CHR has all three AuditCode values (three records) for the value CAR.CallIDX, but it only updates one column.
I must be missing something but I do not know what. Why does the UPDATE not change three columns for the one record in CAR?
Thank you,
djj
The Lord is my shepherd (Psalm 23) - I need someone to lead me!
I have an inner join that joins a one row table to a 10 row table. When I do a select it returns all ten rows:
Code:
SELECT *
FROM CAR -- One row
INNER JOIN CHR -- Ten rows
ON CAR.CallIDX = CHR.CallHistoryIDX
However, I then try to do an update which only does one update:
Code:
UPDATE CAR
SET Condolences = CASE WHEN CHR.AuditCode = '00100' THEN LEFT(CHR.Response, 50) ELSE CAR.Condolences END
,IDSelf = CASE WHEN CHR.AuditCode = '10000' THEN LEFT(CHR.Response, 50) ELSE CAR.IDSelf END
,ConfirmParty = CASE WHEN CHR.AuditCode = '10010' THEN LEFT(CHR.Response, 50) ELSE CAR.ConfirmParty END
FROM CAR
INNER JOIN CHR ON CAR.CallIDX = CHR.CallHistoryIDX
I must be missing something but I do not know what. Why does the UPDATE not change three columns for the one record in CAR?
Thank you,
djj
The Lord is my shepherd (Psalm 23) - I need someone to lead me!