mysql视图
:
mysql> insert into t1 values(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11);
Query OK, 11 rows affected ( sec)
Records: 11 Duplicates: 0 Warnings: 0
:
mysql> select * from t1;
+------+
| id |
+------+
| 1 |
| 2 |
| 3 |
| 4 |
| 5 |
| 6 |
| 7 |
| 8 |
| 9 |
| 10 |
| 11 |
+------+
11 rows in set ( sec)
-10条记录,而t1表还在大量增长着数据,而且量比较大,这个时候,我们就需要把t1表的5-10条拿出来放到一张中间表上或者一个视图
mysql> create view v_t1 as select * from t1 where id>4 and id<11;
Query OK, 0 rows affected ( sec)
:
mysql> ? view
Many help items for your request exist.
To make a more specific request, please type 'help <item>',
where <item> is one of the following
topics:
ALTER VIEW
CREATE VIEW
DROP VIEW
:
mysql> show tables;
+----------------+
mysql视图 来自淘豆网www.taodocs.com转载请标明出处.