SHOW TABLES
描述
该语句用于展示当前 db 下所有的 table
语法:
SHOW [FULL] TABLES [LIKE]
说明:
- LIKE:可按照表名进行模糊查询
示例
-
查看 DB 下所有表
mysql> show tables;
+---------------------------------+
| Tables_in_demo |
+---------------------------------+
| ads_client_biz_aggr_di_20220419 |
| cmy1 |
| cmy2 |
| intern_theme |
| left_table |
+---------------------------------+
5 rows in set (0.00 sec) -
按照表名进行模糊查询
mysql> show tables like '%cm%';
+----------------+
| Tables_in_demo |
+----------------+
| cmy1 |
| cmy2 |
+----------------+
2 rows in set (0.00 sec)
关键词
SHOW, TABLES