This is an old revision of the document!


Views

Views have been introduced in MySQL 5. Views are virtual tables, in that they do not store any data, but rather store a query to dynamically retrieve data from other tables.

CREATE VIEW viewname AS
SELECT ...
SHOW CREATE VIEW viewname
CREATE VIEW media_usage AS
SELECT media.label AS Media_Label, MAX(scenes.end_min + (scenes.end_sec / 60)) AS Time_Used FROM scenes
LEFT JOIN media ON scenes.media_id = media.media_id
GROUP BY scenes.media_id;
  • docs/mysql/views.1187027554.txt.gz
  • Last modified: 2008/08/03 00:25
  • (external edit)