sql - Inner query with same source table as Outer Query -


i went through pl/sql codes , found piece of query not how works. hoping technical advise here.

the piece of query shown below:

select a.rowid   tablea  a.object_name in ('headers','lines','deliveries')    , a.change_type in ('a','c')    , a.rowid not in (select max (b.rowid)                          tablea b                         b.object_name       = a.object_name                           , b.change_type       = a.change_type                           , b.pk1               = a.pk1                           , b.object_identifier = a.object_identifier                        ); 

from know, inner query should run first (correct me if wrong) , inner query result used outer query.

for above query, how inner query run needs data outer query (data alias tablea a).

hope have guidance on fresh in pl/sql development.

thanks!

it not pl/sql, classic sql statement. purpose seams retrieve lines not "last version" (biggest rowid couple pk1 , object_identifier)

the "not in" part retrieve max rowid couple (pk1 , object_identifier) , then, outer query retrive lines not max rowid

in term of execution process, can take @ explain plan see oracle going do.


Comments