About the SELECT List of an Updatable View
In a CREATE VIEW statement, the SELECT column_list for an updatable view must follow these rules:
-
The
SELECTcolumn_listcan contain only single field references. In other words, all columns in theSELECTlist must also be columns in the table referenced in theFROMclause. A view with one or more derived columns is not updatable. A derived column is a column that is generated based on an expression, for example:column1+5,column1||column2. -
The
SELECTcolumn_listcannot be a subquery. -
The
SELECTcolumn_listcannot contain an aggregate function, for example:SUM,MIN,MAX,COUNT(see SQL Aggregate Functions). -
The
SELECTcolumn_listcannot contain theDISTINCTkeyword because doing so would make it possible to not update any row in the underlying table as well as to not update all rows of the underlying table.