Here’s a basic structure of how an update query works:
UPDATE tableName SET column = value WHERE condition = true;
In your case, you’re updating the demo_table new
table with a condition of new.trans_type = 9
.
The tricky thing here is you’re using your sub query as your value to set the columns as. A sub query is basically another query that would return a result. In this case, your sub query is a select
statement from the demo_table old
table.
1
solved pl/sql need to know the techniques behind [closed]