How do MySQL views work?
问题 When I create a view I am basically making a new table that will automatically be transacted upon when data in one of the tables it joins changes; is that correct? Also why can't I use subqueries in my view? 回答1: A view works like a table , but it is not a table. It never exists; it is only a prepared SQL statement that is run when you reference the view name. IE: CREATE VIEW foo AS SELECT * FROM bar SELECT * FROM foo ...is equivalent to running: SELECT x.* FROM (SELECT * FROM bar) x A