I've searched for a solution, but have not yet found one that works...
I'm trying to update multiple values in a column based on distinct values in another column. For example:
If status = F05 then statusID = 987
If status = F12 then statusID = 12957
I've tried this with no success:
UPDATE myTable
SET statusID = CASE status
WHEN 'F05' THEN 987
WHEN 'F12' THEN 12957
END
There are thousands that need updating so, of course, I'd like to run this in a single update query.
What am I missing? What am I doing wrong?
Thanks!
UPDATEquery looks fine. Describe "I've tried this with no success". What happened?