The subquery is treated as a table and app is the name of that table.
Did you try this and does it work? i.e. is it commiting the transaction?