The Rules According to ANSI

The ANSI standard declares that views are read-only (not modifiable) if the CREATE VIEW statement contains any of the following:

  • DISTINCT in the select list

  • Expressions (computed columns, aggregates, functions, and so on) in the select list

  • References to more than one table—in the FROM clause or in a subquery or in a UNION clause

  • References to a view that is itself not updatable, either in the FROM clause or in a subquery

  • A GROUP BY or HAVING clause

Some dialects of SQL are less restrictive than the ANSI standard; others may be more restrictive. You can consult your reference manual, or you can experiment. When you try to modify data through a view, SQL checks to make sure that no restrictions are violated. If it detects ...

Get Practical SQL Handbook, The: Using SQL Variants, Fourth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.