SHOW-DATABASES
Name
SHOW DATABASES
Description
该语句用于展示当前可见的 db
语法:
1. SHOW DATABASES [FROM catalog] [filter expr];
说明:
SHOW DATABASES会展示当前所有的数据库名称.SHOW DATABASES FROM catalog会展示catalog中所有的数据库名称.SHOW DATABASES filter_expr会展示当前所有经过过滤后的数据库名称.SHOW DATABASES FROM catalog filter_expr这种语法不支持.
Example
- 展示当前所有的数据库名称.
1. SHOW DATABASES;
1. +--------------------+
2. | Database |
3. +--------------------+
4. | test |
5. | information_schema |
6. +--------------------+
2. 会展示hms_catalog中所有的数据库名称.
1. SHOW DATABASES from hms_catalog;
1. +---------------+
2. | Database |
3. +---------------+
4. | default |
5. | tpch |
6. +---------------+
3. 展示当前所有经过表示式like 'infor%'过滤后的数据库名称.
1. SHOW DATABASES like 'infor%';
1. +--------------------+
2. | Database |
3. +--------------------+
4. | information_schema |
5. +--------------------+
Keywords
1. SHOW, DATABASES
