Updating multiple rows in gridview


16-Jun-2020 13:40

This is in fact entirely possible in many database systems.In the case of Postgre SQL, it can be done using a FROM clause with UPDATE, like this: This does an INNER JOIN between the tables “staff” and “updates” where the column “name” matches.This is the intention of UPDATE staff SET salary = 1200 WHERE name = ' Bob'; UPDATE staff SET salary = 1200 WHERE name = ' Jane'; UPDATE staff SET salary = 1200 WHERE name = ' Frank'; UPDATE staff SET salary = 1200 WHERE name = ' Susan'; UPDATE staff SET salary = 1200 WHERE name = ' John'; “key_columns” specifies the columns which will be used to identify rows which need to be updated (using WHERE). The first element provides the value of the column (specified by “key_columns”) to identify the row to be updated.“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”.

The dominant factor in the time taken to complete the overall operation tends to be the “admin” work in conveying the application’s intention to the database server rather than the actual updates to the database.

Even if we wanted to update a thousand rows with different values, we could still do it with four statements.



Google Chat was officially shut down on June 26, 2017.… continue reading »


Read more

Each service has a different catalogue of videos to watch and has different features.… continue reading »


Read more

Like, of course you might fling your head back from someone punched you, but your "fight of flight" may also kick in if someone invaded your personal space.… continue reading »


Read more