SHOW SINGLE TABLE
Syntax
- When
databaseName
is not specified, the default is the currently used DATABASE
. If DATABASE
is not used, No database selected
will be prompted.
Return value description
- Query specified single table for specified database.
SHOW SINGLE TABLE t_user FROM sharding_db;
mysql> SHOW SINGLE TABLE t_user FROM sharding_db;
+------------+---------------+
| table_name | resource_name |
| t_user | ds_0 |
+------------+---------------+
1 row in set (0.00 sec)
- Query specified single table for current database.
- Query single tables for specified database.
SHOW SINGLE TABLES FROM sharding_db;
mysql> SHOW SINGLE TABLES FROM sharding_db;
+------------+---------------+
| table_name | resource_name |
+------------+---------------+
| t_user | ds_0 |
+------------+---------------+
- Query single tables for current database.
SHOW SINGLE TABLES;
- Query the single tables whose table name end with
order_5
for the specified logic database.
SHOW SINGLE TABLES LIKE '%order_5' FROM sharding_db;
mysql> SHOW SINGLE TABLES LIKE '%order_5' FROM sharding_db;
| table_name | storage_unit_name |
+------------+-------------------+
| t_order_5 | ds_1 |
+------------+-------------------+
1 row in set (0.11 sec)
- Query the single tables whose table name end with
order_5
for the current logic database
SHOW SINGLE TABLES LIKE '%order_5';
Reserved word