Restrictions on views
Because a view is not really a table, it cannot be indexed, and it cannot be the object of such statements as ALTER TABLE and RENAME TABLE. You cannot rename the columns of a view with RENAME COLUMN. To change anything about the definition of a view, you must drop the view and re-create it.
Because it must be merged with
the user's query, the SELECT statement on which a view is based cannot
contain the following clauses or keywords:
- INTO TEMP
- The user's query might contain INTO TEMP; if the view also contains it, the data would not know where to go.
- ORDER BY
- The user's query might contain ORDER BY. If the view also contains it, the choice of columns or sort directions can be in conflict.
A SELECT statement on which you base a view can contain the UNION keyword. In such cases, the database server stores the view in an implicit temporary table where the unions are evaluated as necessary. The user's query uses this temporary table as a base table.