FROM

DISTINCT
UNIQUE

ALL

SELECT_LIST -----------------> FROM

SELECT_LIST -----------------> FROM

table_reference

table_reference

ONLY(query_table_expression)
query_table_expression

ONLY(query_table_expression)
query_table_expression
sample_clause

sample_clause

partition_extention_clause

partition_extention_clause

subquery_restriction_clause

subquery_restriction_clause

FLASHBACK_QUERY_CLAUSE

FLASHBACK_QUERY_CLAUSE

pivot_clause
unpivot_clause
row_pattern_clause

r

table_reference PIVOT [ XML ] ( aggregate_function ( expr ) [[AS] alias ] [, aggregate_function ( expr ) [[AS] alias ] ]... pivot_for_clause pivot_in_clause )FOR { column | ( column [, column]... ) } IN ( { { { expr | ( expr [, expr]... ) } [ [ AS] alias] }... | subquery | ANY [, ANY]... } )table_reference UNPIVOT [ {INCLUDE | EXCLUDE} NULLS ]( { column | ( column [, column]... ) } pivot_for_clause unpivot_in_clause)IN( { column | ( column [, column]... ) } [ AS { literal | ( literal [, literal]... ) } ] [, { column | ( column [, column]... ) } [ AS {literal | ( literal [, literal]... ) } ] ]...)table_reference UNPIVOT [ {INCLUDE | EXCLUDE} NULLS ]( { column | ( column [, column]... ) } pivot_for_clause unpivot_in_clause)IN( { column | ( column [, column]... ) } [ AS { literal | ( literal [, literal]... ) } ] [, { column | ( column [, column]... ) } [ AS {literal | ( literal [, literal]... ) } ] ]...)MATCH_RECOGNIZE { [ row_pattern_partition_by ] [ row_pattern_order_by ] [ row_pattern_measures ] [ row_pattern_rows_per_match ] [ row_pattern_skip_to ] PATTERN (row_pattern) [ row_pattern_subset_clause ] DEFINE row_pattern_definition_list }

pivot_clause

pivot_clause

unpivot_clause

unpivot_clause

t_alias

join_clause

join_clause

inner_cross_join_clause

inner_cross_join_clause

outer_join_clause

outer_join_clause

query_partition_clause

query_partition_clause

outer_join_type

outer_join_type

cross_outer_apply_clause

cross_outer_apply_clause

(join_clause)

row_pattern_clause

row_pattern_clause

row_pattern_partition_by

row_pattern_partition_by

row_pattern_order_by

row_pattern_order_by

row_pattern_measures

row_pattern_measures

row_pattern_measure_column

row_pattern_measure_column

row_pattern_rows_per_match

row_pattern_rows_per_match

row_pattern_skip_to

row_pattern_skip_to

row_pattern

row_pattern

row_pattern_term

row_pattern_term

row_pattern_factor

row_pattern_factor

row_pattern_quantifier

row_pattern_quantifier

row_pattern_primary

row_pattern_primary

row_pattern_permute

row_pattern_permute

row_pattern_subset_clause

row_pattern_subset_clause

row_pattern_subset_item

row_pattern_subset_item

row_pattern_definition_list

row_pattern_definition_list

row_pattern_definition

row_pattern_definition
WITH

WITH

plsql_declarations

plsql_declarations
r

FUNCTION...;PROCEDURE...;

subquery_factoring_clause

r

QUERY_NAME AS (SUBQUERY) SEARCH_CLAUSE CYCLE_CLAUSE

SUBQUERY

SEARCH_CLAUSE

SEARCH_CLAUSE

CYCLE_CLAUSE

CYCLE_CLAUSE

model_clause

model_clause

cell_reference_options

cell_reference_options

return_rows_clause

return_rows_clause

reference_model

reference_model

main_model

main_model

group_by_clause

group_by_clause

rollup_cube_clause

rollup_cube_clause

grouping_sets_clause

grouping_sets_clause

model_iterate_clause

model_iterate_clause

multi_column_loop

multi_column_loop

hint

single_column_loop

single_column_loop

hierarchical_query_clause

hierarchical_query_clause
condition

condition

where_clause

where_clause

model_column_clause

model_column_clause

cell_assignment

cell_assignment

model_rules_clause

model_rules_clause

grouping_expression_list

grouping_expression_list

expression_list

expression_list

QUERY_BLOCK

QUERY_BLOCK

FOR UPDATE

FOR UPDATE
r

SELECT e.employee_id, e.salary, e.commission_pct FROM employees e, departments d WHERE job_id = 'SA_REP' AND e.department_id = d.department_id AND location_id = 2500 ORDER BY e.employee_id FOR UPDATE;SELECT e.employee_id, e.salary, e.commission_pct FROM employees e JOIN departments d USING (department_id) WHERE job_id = 'SA_REP' AND location_id = 2500 ORDER BY e.employee_id FOR UPDATE OF e.salary;SELECT employee_id FROM (SELECT * FROM employees) FOR UPDATE OF employee_id;SELECT employee_id FROM (SELECT employee_id+1 AS employee_id FROM employees) FOR UPDATE;Since the FOR UPDATE clause is not supported on views, anything that prevents view merging, such as the NO_MERGE hint, parameters that disallow view merging, or something in the query structure that prevents view merging, will result in an ORA-02014 error.In the following example, the GROUP BY statement prevents view merging, which causes an error:SELECT avgsal FROM (SELECT AVG(salary) AS avgsal FROM employees GROUP BY job_id) FOR UPDATE;FROM (SELECT AVG(salary) AS avgsal FROM employees GROUP BY job_id) *ERROR at line 2:ORA-02014: cannot select FOR UPDATE from view with DISTINCT, GROUP BY, etc.

where_clause

hierarchical_query_clause

group_by_clause

model_clause

with_clause

select_list

table_reference
join_clause
(join_clause)

SUBQUERY

SUBQUERY

row_limiting_clause

row_limiting_clause

order_by_clause

order_by_clause
model_column

model_column

row_pattern_rec_func

row_pattern_rec_func

row_pattern_classifier_func

row_pattern_classifier_func

row_pattern_mach_num_func

row_pattern_navigation_func

row_pattern_navigation_func

row_pattern_nav_logical

row_pattern_nav_logical

row_pattern_nav_physical

row_pattern_nav_physical

row_pattern_nav_compound

row_pattern_nav_compound

row_pattern_aggregate_func

row_pattern_aggregate_func