docs:mysql:views

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.txt
  • Last modified: 2008/08/03 00:25
  • by 127.0.0.1