• Introduction
  • 1. How to Retrieve Data From a Single Table
  • 2. How to Retrieve Data from Multiple Tables
  • 3. Using Functions
  • 4. How to Insert, Update, Delete Data in Tables
  • 5. Summary Queries and Aggregate Functions
  • 6. Working With Subqueries
  • 7. SQL Views
  • 8. SQL Indexes
  • Glossary
  • Index
  • Download
  • Translations
  • 7.3

    Views That Allow UPDATE Statements

    Creating Views That Can Be Used With an UPDATE Statement

    • There are some restrictions to creating a VIEW if you want to be able to run an UPDATE statement against it.
      • SELECT list cannot include a DISTINCT clause.
      • SELECT list cannot contain aggregate functions (SUM, COUNT, MIN, MAX, AVG, COUNT(*))
      • SELECT statement cannot use GROUP BY or HAVING. The VIEW cannot include a UNION operator.
    • If you use any of the restricted statements, your view will be read-only.

    This content is provided to you freely by BYU-I Books.

    Access it online or download it at https://books.byui.edu/learning_mysql/creating_views_that_.