Hi there!
I'm currently having a problem. I need to update Table A from Table B based on this condition:
- If one record in Table A is null (ex. name) then update that record from Table B
Here's my error driven script which I thought from my head. This is what I wanted to happen.
UPDATE TableA
SET
NAME =
(
CASE WHEN TableA.NAME IS NULL THEN
SELECT TableB.NAME
FROM TableB
WHERE TableB._ID = 1
),
ADDRESS =
(
CASE WHEN TableA.ADDRESS IS NULL THEN
SELECT TableB.ADDRESS
FROM TableB
WHERE TableB._ID = 1
)
WHERE TableA._ID = 1
Something like that. Any ideas?