SHOW SINGLE TABLE
Description
The SHOW SINGLE TABLE
syntax is used to query single tables for specified database.
Syntax
ShowSingleTable::=
'SHOW' 'SINGLE' ('TABLES'|'TABLE' tableName) ('FROM' databaseName)?
tableName ::=
identifier
databaseName ::=
identifier
Supplement
- When
databaseName
is not specified, the default is the currently usedDATABASE
. IfDATABASE
is not used,No database selected
will be prompted.
Return value description
Column | Description |
---|---|
table_name | Single table name |
resource_name | The resource name where the single table is located |
Example
- Query specified single table for specified database.
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)
- Query specified single table for current database.
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)
- Query single tables for specified database.
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)
- Query single tables for current database.
SHOW SINGLE TABLES;
mysql> SHOW SINGLE TABLES;
+------------+---------------+
| table_name | resource_name |
+------------+---------------+
| t_user | ds_0 |
+------------+---------------+
1 row in set (0.00 sec)
Reserved word
SHOW
, SINGLE
, TABLE
, TABLES
, FROM
Related links
当前内容版权归 ShardingSphere 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 ShardingSphere .