“value_columns” specifies the columns which will be updated (using SET). The second element provides the value to be SET in the column specified by “value_columns”.In this case, will spot that the target values are all 1200, and will effect the desired changes using a single UPDATE statement as described above.But if there are a large number of rows that require an update, then the overhead of issuing large numbers of UPDATE statements can result in the operation as a whole taking a long time to complete.The traditional advice for improving performance for multiple UPDATE statements is to “prepare” the required query once, and then “execute” the prepared query once for each row requiring an update.But in many cases this only provides a modest improvement as each UPDATE operation still requires a round-trip communication with the database server.In the case where the application server and database server are on different hosts, the round-trip will involve network latency as well.
For small numbers of rows requiring updates, it can be adequate to use an UPDATE statement for each row that requires an update.
(It will use placeholders and parameter binding if it thinks it’s appropriate.) If given our second example with two distinct values, will spot that there are two distinct values, 12, and will effect this with two UPDATE statements as described above.
Optimising the number of UPDATEs by grouping the distinct SET values can be done in a way which is compatible with most common SQL databases. FROM approach requires knowledge of the specific SQL database being used.
and we could persuade the database server to apply those updates to the target table?
This is in fact entirely possible in many database systems.