SHOW SINGLE TABLE
语法用于查询指定逻辑库中的单表。
ShowSingleTable::=
'SHOW' 'SINGLE' ('TABLES'|'TABLE' tableName) ('FROM' databaseName)?
tableName ::=
identifier
databaseName ::=
identifier
databaseName
时,默认是当前使用的 DATABASE
。 如果也未使用 DATABASE
则会提示 No database selected
。列 | 说明 |
---|---|
table_name | 单表名称 |
resource_name | 单表所在的数据源名称 |
SHOW SINGLE TABLE t_user FROM test1;
mysql> SHOW SINGLE TABLE t_user FROM test1;
+------------+---------------+
| table_name | resource_name |
+------------+---------------+
| t_user | ds_0 |
+------------+---------------+
1 row in set (0.00 sec)
SHOW SINGLE TABLE t_user;
mysql> SHOW SINGLE TABLE t_user;
+------------+---------------+
| table_name | resource_name |
+------------+---------------+
| t_user | ds_0 |
+------------+---------------+
1 row in set (0.00 sec)
SHOW SINGLE TABLES FROM test1;
mysql> SHOW SINGLE TABLES FROM test1;
+------------+---------------+
| table_name | resource_name |
+------------+---------------+
| t_user | ds_0 |
+------------+---------------+
1 row in set (0.00 sec)
SHOW SINGLE TABLES;
mysql> SHOW SINGLE TABLES;
+------------+---------------+
| table_name | resource_name |
+------------+---------------+
| t_user | ds_0 |
+------------+---------------+
1 row in set (0.00 sec)
SHOW
、SINGLE
、TABLE
、TABLES
、FROM