I have a table "Master" with fields called "DFM" and "Target". I ideally need 1 UPDATE query that will populate the "Target" field based on the value of DFM as below:
DFM Target
50001 85
50009 255
50011 233
50012 290
50062 183
50063 150
50064 159.5
50142 187
50143 174
50179 284.25
50180 195.75
50286 157.25
50287 231.25
For example if the DFM value is 50142 it should UPDATE the field for that row with 187.
So can this be done with 1 query, or do I need 13?
I only know the long winded way ie
UPDATE Master, SET Target = 85 WHERE DFM = 50001
I don't really want 13 queries though.
Mastertable already has the values forTargetyou want to update them to. As you looking to update theTargetfield on some other table based on the values onMasteror the values onMasterbased on some other lookup table?targetis not populated at all or if all your potential values fordfmhave a replacement value inside the switch you can also skip thewherepart of it.