Here's the demo for pabldy's first option -
With a table of new values laid out like this -
Code:
tblNewVal
WVal ZVal NewY
3 4 a
5 6 b
8 10 a
You can have a single update like this -
Code:
UPDATE MyTable AS T1, tblNewVal AS TN
SET T1.Y = TN.NewY
WHERE T1.W = TN.WVal
AND T1.Z = TN.ZVal;
But first check for dups in your conditions with something like this -
Code:
SELECT WVal, ZVal, Count(NewY)
FROM tblNewVal
GROUP BY Wval, ZVal
HAVING Count(NewY) > 1;
And check for unmet/unset conditions like this -
Code:
SELECT T1.W, T1.Z
FROM MyTable AS T1 LEFT JOIN tblNewVal AS TN
ON T1.W = TN.WVal AND T1.Z = TN.ZVal
WHERE TN.NewY Is Null;