table

Description

Identifies a base table that occurs in a subquery or view or that is assigned a correlation name in the from clause of the query.

Syntax

( table table_name [ qualification ] )
( table ( correlation_name table_name) )

Parameters

table_name

is a base table. If the query uses the database name and/or owner name, the abstract plan must also provide them.

correlation_name

is the correlation name, if a correlation name is used in the query.

qualification

is either in (subq subquery_id) or in (view view_name).

Examples

Example 1

select * from t1 table1, t2 table2
where table1.c11 = table2.c21

( nl_g_join 
    ( t_scan ( table ( table1 t1 ) ) )
    ( t_scan ( table ( table2 t2 ) ) )
)

Tables t1 and t2 are identified by reference to the correlation names used in the query.

Example 2

select c11 from t1
where c12 = 
        (select c21 from t2 where c22 = t1.c11)

( nested 
        ( t_scan t1 ) 
        ( subq 1 
                ( t_scan ( table t2 ( in ( subq 1 ) ) ) ) 
        ) 
) 

Table t2 in the subquery is identified by reference to the subquery.

Example 3

create view v1
as
select * from t1 where c12 > 100

select t1.c11 from t1, v1
where t1.c12 = v1.c11

( nl_g_join 
        ( t_scan t1 ) 
        ( i_scan 2 ( table t1 ( in ( view v1 ) ) ) )

Table t1 in the view is identified by reference to the view.

Usage

See also

in, subq, view