Neoview SQL Reference Manual (R2.4 SP2)

Create view v as select a from t order by a;
Select * from v x, v y;
Or this INSERT statement:
Insert into t1 select * from v;
In these two examples, the ORDER BY clause is ignored during DML processing because the
first appears as part of a derived table and the second as a subquery selects, both created after
the view expansion.
If the same query is issued using explicit derived tables instead of a view, a syntax error is
returned:
Select * from (select a from t order by a) x, (select a from t order by a) y;
This example returns a syntax error because an ORDER BY clause is not supported in a subquery.
The ORDER BY clause is ignored if it is part of a view and used in places where it is not supported.
This is different than returning an error when the same query was written with explicit ORDER
BY clause, as is shown in the preceding examples.
ORDER BY in a View Definition With No Override
If the SELECT query reads from the view with no explicit ORDER BY override, the ORDER BY
semantics of the view definition are used.
In this example, the ordering column is the one specified in the CREATE VIEW statement:
Create view v as select * from t order by a
Select * from v
The SELECT query becomes equivalent to:
Select * from t order by a;
ORDER BY in a View Definition With User Override
If a SELECT query contains an explicit ORDER BY clause, it overrides the ORDER BY clause
specified in the view definition.
For example:
Create view v as select a,b from t order by a;
Select * from v order by b;
In this example, order by b overrides the order by a specified in the view definition.
The SELECT query becomes equivalent to:
Select a,b from t order by b;
Nested View Definitions
In case of nested view definitions, the ORDER BY clause in the topmost view definition overrides
the ORDER BY clause of any nested view definitions.
For example:
Create view v1 as select a,b from t1 order by a;
Create view v2 as select a,b from v1 order by b;
Select * from v2;
In this example, the ORDER BY specified in the definition of view v2 overrides the ORDER BY
specified in the definition of view v1.
The SELECT query becomes equivalent to:
Select a,b from (select a, b from t) x order by b;
Examples of CREATE VIEW
This example creates a view on a single table without a view column list:
104 SQL Statements