Let's say my table of myTable
has a column1 that has some values already in it.
Now I am given some new values that I should put in a newly created column named 'column2
' .
These are one to one associated together and unique. So for example:
column1 | column2
-----------------
'ABCHi' | 'newOH'
-----------------
'TER12' | 'Meow2'
-----------------
'WhatE' | 'BMW26'
-----------------
So I could say like:
Update myTable SET column2 = 'newOH' WHERE column1 = 'ABCHi'
and do that for each of those rows ( I have 32 of them to do ).
But I thought maybe there is a "nicer" way of doing this? Like if it was C#
I could say populate a dictionary
and then do a for-each
loop!