Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== 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 ===== <code> CREATE VIEW viewname AS SELECT ... </code> ===== Showing the query of a View ===== <code> SHOW CREATE VIEW viewname </code> ===== Example ===== <code> 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; </code> docs/mysql/views.txt Last modified: 2008/08/03 00:25by 127.0.0.1