Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Behavior of INSERT from subquery using same table

David BalažicMay 15 2016 — edited May 16 2016

(it seems my google-fu is weak, as I cant find anything on this subject)

What is the behavior when inserting into a table based on a query on the same table?

For example:

insert into t1 select a,b+1 from t1

will the SELECT part only consider rows the were present before starting this statement? OR will it also consider new rows? If yes, when?

Note that the above is a simplified example. It could be a multitable insert where the SELECT is a join of multiple tables (let's say only one of source tables is also inserted into).

I case different version behave differently, I am interested in 11.2.

Regards,

David

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 13 2016
Added on May 15 2016
3 comments
505 views