) appends "for update" to selects some of which however don't allow "for update".
Thanks to Erik for having pointed out that in DB2, FOR UPDATE cannot be used under the following conditions:
On the database manager, the result table is read-only if the cursor is based on a VALUES statement or the SELECT statement contains any of the following:
* The DISTINCT keyword
* A column function in the SELECT list
* A GROUP BY, HAVING, or ORDER BY clause
* A FROM clause that identifies one of the following:
o More than one table or view
o A read-only view
o An OUTER clause with a typed table or typed view
o A table or view that is also identified in the FROM clause of a subquery of the SELECT statement. (NOTE: This is only a restriction on version of DB2 prior to Version 2).
* A set operator (other than UNION ALL).
Note that these conditions do not apply to subqueries of the SELECT statement.