Syntax

A view definition can contain an optional view column list to explicitly
name the columns in the view. If there is no column list, the view
inherits the column names from the underlying query. All columns in a
view must be uniquely named.

view-Name

The name to assign to the view.

Simple-column-Name*

An optional list of names to be used for columns of the view. If not
given, the column names are deduced from the query.

The maximum number of columns in a view is
5000.

AS Query [ORDER BY clause]

A SELECT or VALUES command that provides the columns and rows of the
view.

result offset and fetch first clauses

The FETCH FIRST clause, which can
be combined with the RESULT OFFSET clause, limits the number of rows
added to the view.

Examples

This example creates a view that shows the age of each player in our
database:

Statement Dependency System

View definitions are dependent on the tables and views referenced within
the view definition. DML (data manipulation language) statements that
contain view references depend on those views, as well as the objects in
the view definitions that the views are dependent on. Statements that
reference the view depend on indexes the view uses; which index a view
uses can change from statement to statement based on how the query is
optimized. For example, given: