0
I need to perform an update several times as follows:
UPDATE my_table set column1='value1', column2='value2' where primary_key1=1 and primary_key2=2;
UPDATE my_table set column1='value3', column2='value4' where primary_key1=3 and primary_key2=4;
UPDATE my_table set column1='value5', column2='value6' where primary_key1=5 and primary_key2=6;
.
.
.
UPDATE my_table set column1='valueX', column2='valueY' where primary_key1=W and primary_key2=Z;
How do I perform this process in Bulk in the stored database of a mysql database? Is it possible?
Would you like to do this process in a loop using for example a foreach? Pass values to be changed by parameter or get through a select?
– Thiagosilr
I want to run this query only once and perform multiple updates. If the table has only one primary key, it is very quiet. My question is when there is composite primary key.
– milho