嗨我注意到我的SQL case語句不正確,並且將字段Age設置爲NULL爲IDS 1-3。我將如何阻止這種情況發生?將SQL Case語句設置爲NULL對於某些
感謝
UPDATE table
SET `Name` = CASE `id`
WHEN 1 THEN 'Sam'
WHEN 2 THEN 'Adam'
WHEN 3 THEN 'James'
WHEN 4 THEN 'Chris'
END,
`Age` = CASE `id`
WHEN 4 THEN '22'
END
WHERE `id` IN (1,2,3,4)