当前位置:Gxlcms > 数据库问题 > 数据库-mysql视图

数据库-mysql视图

时间:2021-07-01 10:21:17 帮助过:13人阅读

student; Query OK, 0 rows affected (0.02 sec) MariaDB [test2]> show tables; +-----------------+ | Tables_in_test2 | +-----------------+ | a | | b | | student | | student2 | +-----------------+ 4 rows in set (0.00 sec)

二:删除视图

  drop view viewname

MariaDB [test2]> drop view student2;
Query OK, 0 rows affected (0.00 sec)

MariaDB [test2]> show tables;
+-----------------+
| Tables_in_test2 |
+-----------------+
| a               |
| b               |
| student         |
+-----------------+
3 rows in set (0.00 sec)

 

三:修改视图

  alter view viewname as select tname from table1,table2 where condition

  

MariaDB [test2]> alter view student2 as select * from a;
Query OK, 0 rows affected (0.00 sec)

 

数据库-mysql视图

标签:sql   数据集   用户   tab   名称   str   alt   create   table   

人气教程排行