A view from two tables
suggest changeA view is most useful when it can be used to pull in data from more than one table.
CREATE VIEW myview AS
SELECT a.*, b.extra_data FROM main_table a
LEFT OUTER JOIN other_table b
ON a.id = b.id
In mysql views are not materialized. If you now perform the simple query SELECT * FROM myview
, mysql will actually perform the LEFT JOIN behind the scene.
A view once created can be joined to other views or tables
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents