I have an application where I find a sum() of a database column for a set of records and later use that sum in a separate query, similar to the following (made up tables, bu
The syntax select . . . for update locks records in a table to prepare for an update. When you do an aggregation, the result set no longer refers to the original rows.
In other words, there are no records in the database to update. There is just a temporary result set.