如何在當前使用的資料庫中檢視MySQL表的列表以及結果集中的表型別?
可以使用 SHOW FULL TABLES 語句實現。其語法如下:
語法
SHOW FULL TABLES
示例
在下面的示例中,我們當前的資料庫是“query”,因此下面的語句將顯示該資料庫中表的列表以及結果集中的表型別:
mysql> SHOW FULL TABLES; +-----------------------------+------------+ | Tables_in_query | Table_type | +-----------------------------+------------+ | accounts | BASE TABLE | | address | BASE TABLE | | cars | BASE TABLE | | cars_avgprice | VIEW | | countries | BASE TABLE | | customer_view | VIEW | | customers | BASE TABLE | | date_time_test | BASE TABLE | | detail_bday | BASE TABLE | | details_city | BASE TABLE | . . . | view_student_detail | VIEW | | view_student_detail_columns | VIEW | | websites | BASE TABLE | +-----------------------------+------------+ 87 rows in set (0.01 sec)
上述結果集顯示了表以及表型別,即它是基本表還是檢視。
廣告
資料結構
網路
關係資料庫管理系統 (RDBMS)
作業系統
Java
iOS
HTML
CSS
Android
Python
C語言程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP