借助以下查询,我们可以查看存储在特定数据库中的视图列表。我们在这里使用名为“query”的数据库。Mysql> SELECT TABLE_NAME FROM infORMation_schema.`TABLES` WHER
借助以下查询,我们可以查看存储在特定数据库中的视图列表。我们在这里使用名为“query”的数据库。
Mysql> SELECT TABLE_NAME FROM infORMation_schema.`TABLES` WHERE TABLE_TYPE LIKE'view' AND TABLE_SCHEMA LIKE 'query';
+-----------------------------+
| TABLE_NAME |
+-----------------------------+
| customer_view |
| first_view |
| info |
| info_less |
| view_detail |
| view_student_detail |
| view_student_detail_columns |
+-----------------------------+
7 rows in set (0.01 sec)
mysql> SHOW FULL TABLES IN query WHERE TABLE_TYPE LIKE 'VIEW';
+-----------------------------+------------+
| Tables_in_query | Table_type |
+-----------------------------+------------+
| customer_view | VIEW |
| first_view | VIEW |
| info | VIEW |
| info_less | VIEW |
| view_detail | VIEW |
| view_student_detail | VIEW |
| view_student_detail_columns | VIEW |
+-----------------------------+------------+
7 rows in set (0.01 sec)
mysql> SELECT TABLE_SCHEMA, TABLE_NAME
-> FROM information_schema.tables
-> WHERE TABLE_TYPE LIKE 'VIEW'AND TABLE_SCHEMA = 'query';
+--------------+-----------------------------+
| TABLE_SCHEMA | TABLE_NAME |
+--------------+-----------------------------+
| query | customer_view |
| query | first_view |
| query | info |
| query | info_less |
| query | view_detail |
| query | view_student_detail |
| query | view_student_detail_columns |
+--------------+-----------------------------+
7 rows in set (0.05 sec)
--结束END--
本文标题: 我们如何查看存储在特定 MySQL 数据库中的视图列表?
本文链接: https://www.lsjlt.com/news/436440.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-05-09
2024-05-09
2024-05-09
2024-05-09
2024-05-08
2024-05-08
2024-05-08
2024-05-08
2024-05-08
2024-05-08
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0