Update show.md

Translate to Chinese version.
This commit is contained in:
Tom Bombadil 2020-06-21 14:30:06 +08:00 committed by GitHub
parent bcf086e592
commit 2a040777ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,19 +1,17 @@
--- ---
machine_translated: true
machine_translated_rev: 72537a2d527c63c07aa5d2361a8829f3895cf2bd
toc_priority: 38 toc_priority: 38
toc_title: SHOW toc_title: SHOW
--- ---
# 显示查询 {#show-queries} # SHOW 查询 {#show-queries}
## SHOW CREATE TABLE {#show-create-table} ## SHOW CREATE TABLE {#show-create-table}
``` sql ``` sql
SHOW CREATE [TEMPORARY] [TABLE|DICTIONARY] [db.]table [INTO OUTFILE filename] [FORMAT format] SHOW CREATE [TEMPORARY] [TABLE|DICTIONARY] [db.]table [INTO OUTFILE filename] [FORMAT format]
``` ```
返回单个字符串类型的 statement其中只包含了一个值 - 用来创建指定对象的 `CREATE` 语句。
返回单 `String`-类型 statement column, which contains a single value the `CREATE` 用于创建指定对象的查询。
## SHOW DATABASES {#show-databases} ## SHOW DATABASES {#show-databases}
@ -21,8 +19,7 @@ SHOW CREATE [TEMPORARY] [TABLE|DICTIONARY] [db.]table [INTO OUTFILE filename] [F
SHOW DATABASES [INTO OUTFILE filename] [FORMAT format] SHOW DATABASES [INTO OUTFILE filename] [FORMAT format]
``` ```
打印所有数据库的列表。 打印所有的数据库列表,该查询等同于 `SELECT name FROM system.databases [INTO OUTFILE filename] [FORMAT format]`
这个查询是相同的 `SELECT name FROM system.databases [INTO OUTFILE filename] [FORMAT format]`.
## SHOW PROCESSLIST {#show-processlist} ## SHOW PROCESSLIST {#show-processlist}
@ -30,11 +27,13 @@ SHOW DATABASES [INTO OUTFILE filename] [FORMAT format]
SHOW PROCESSLIST [INTO OUTFILE filename] [FORMAT format] SHOW PROCESSLIST [INTO OUTFILE filename] [FORMAT format]
``` ```
输出的内容 [系统。流程](../../operations/system-tables.md#system_tables-processes) 表,包含目前正在处理的查询列表,除了 `SHOW PROCESSLIST` 查询。 输出 [system.processes](../../operations/system-tables/processes.md#system_tables-processes)表的内容,包含有当前正在处理的请求列表,除了 `SHOW PROCESSLIST`查询。
`SELECT * FROM system.processes` 查询返回有关所有当前查询的数据。
提示(在控制台中执行): `SELECT * FROM system.processes` 查询返回和当前请求相关的所有数据
提示 (在控制台执行):
``` bash ``` bash
$ watch -n1 "clickhouse-client --query='SHOW PROCESSLIST'" $ watch -n1 "clickhouse-client --query='SHOW PROCESSLIST'"
@ -42,15 +41,15 @@ $ watch -n1 "clickhouse-client --query='SHOW PROCESSLIST'"
## SHOW TABLES {#show-tables} ## SHOW TABLES {#show-tables}
显示表的列表。 显示表的清单
``` sql ``` sql
SHOW [TEMPORARY] TABLES [{FROM | IN} <db>] [LIKE '<pattern>' | WHERE expr] [LIMIT <N>] [INTO OUTFILE <filename>] [FORMAT <format>] SHOW [TEMPORARY] TABLES [{FROM | IN} <db>] [LIKE '<pattern>' | WHERE expr] [LIMIT <N>] [INTO OUTFILE <filename>] [FORMAT <format>]
``` ```
如果 `FROM` 如果未指定子句,则查询返回当前数据库中的表列表。 如果未使用 `FROM` 字句,该查询返回当前数据库的所有表清单
你可以得到相同的结果 `SHOW TABLES` 通过以下方式进行查询: 可以用下面的方式获得和 `SHOW TABLES`一样的结果:
``` sql ``` sql
SELECT name FROM system.tables WHERE database = <db> [AND name LIKE <pattern>] [LIMIT <N>] [INTO OUTFILE <filename>] [FORMAT <format>] SELECT name FROM system.tables WHERE database = <db> [AND name LIKE <pattern>] [LIMIT <N>] [INTO OUTFILE <filename>] [FORMAT <format>]
@ -58,7 +57,7 @@ SELECT name FROM system.tables WHERE database = <db> [AND name LIKE <pattern>] [
**示例** **示例**
面的查询从表的列表中选择前两行 `system` 数据库,其名称包含 `co`. 列查询获取最前面的2个位于`system`库中且表名包含 `co`的表。
``` sql ``` sql
SHOW TABLES FROM system LIKE '%co%' LIMIT 2 SHOW TABLES FROM system LIKE '%co%' LIMIT 2
@ -73,15 +72,15 @@ SHOW TABLES FROM system LIKE '%co%' LIMIT 2
## SHOW DICTIONARIES {#show-dictionaries} ## SHOW DICTIONARIES {#show-dictionaries}
显示列表 [外部字典](../../sql-reference/dictionaries/external-dictionaries/external-dicts.md). 以列表形式显示 [外部字典](../../sql-reference/dictionaries/external-dictionaries/external-dicts.md).
``` sql ``` sql
SHOW DICTIONARIES [FROM <db>] [LIKE '<pattern>'] [LIMIT <N>] [INTO OUTFILE <filename>] [FORMAT <format>] SHOW DICTIONARIES [FROM <db>] [LIKE '<pattern>'] [LIMIT <N>] [INTO OUTFILE <filename>] [FORMAT <format>]
``` ```
如果 `FROM` 如果未指定子句,则查询从当前数据库返回字典列表。 如果 `FROM`字句没有指定,返回当前数据库的字典列表
你可以得到相同的结果 `SHOW DICTIONARIES` 通过以下方式进行查询: 可以通过下面的查询获取和 `SHOW DICTIONARIES`相同的结果:
``` sql ``` sql
SELECT name FROM system.dictionaries WHERE database = <db> [AND name LIKE <pattern>] [LIMIT <N>] [INTO OUTFILE <filename>] [FORMAT <format>] SELECT name FROM system.dictionaries WHERE database = <db> [AND name LIKE <pattern>] [LIMIT <N>] [INTO OUTFILE <filename>] [FORMAT <format>]
@ -89,7 +88,7 @@ SELECT name FROM system.dictionaries WHERE database = <db> [AND name LIKE <patte
**示例** **示例**
面的查询从表的列表中选择前两行 `system` 数据库,其名称包含 `reg`. 列查询获取最前面的2个位于 `system`库中且名称包含 `reg`的字典表。
``` sql ``` sql
SHOW DICTIONARIES FROM db LIKE '%reg%' LIMIT 2 SHOW DICTIONARIES FROM db LIKE '%reg%' LIMIT 2
@ -104,7 +103,7 @@ SHOW DICTIONARIES FROM db LIKE '%reg%' LIMIT 2
## SHOW GRANTS {#show-grants-statement} ## SHOW GRANTS {#show-grants-statement}
显示用户的权限 显示用户的权限
### 语法 {#show-grants-syntax} ### 语法 {#show-grants-syntax}
@ -112,13 +111,13 @@ SHOW DICTIONARIES FROM db LIKE '%reg%' LIMIT 2
SHOW GRANTS [FOR user] SHOW GRANTS [FOR user]
``` ```
如果未指定user则查询返回当前用户的权限。 如果未指定用户,输出当前用户的权限
## SHOW CREATE USER {#show-create-user-statement} ## SHOW CREATE USER {#show-create-user-statement}
显示了在使用的参数 [用户创建](create.md#create-user-statement). 显示 [user creation](../../sql-reference/statements/create.md#create-user-statement)用到的参数。
`SHOW CREATE USER`输出用户密码。 `SHOW CREATE USER`会输出用户的密码信息
### 语法 {#show-create-user-syntax} ### 语法 {#show-create-user-syntax}
@ -128,7 +127,7 @@ SHOW CREATE USER [name | CURRENT_USER]
## SHOW CREATE ROLE {#show-create-role-statement} ## SHOW CREATE ROLE {#show-create-role-statement}
显示了在使用的参数 [角色创建](create.md#create-role-statement) 显示 [role creation](../../sql-reference/statements/create.md#create-role-statement) 中用到的参数。
### 语法 {#show-create-role-syntax} ### 语法 {#show-create-role-syntax}
@ -138,7 +137,7 @@ SHOW CREATE ROLE name
## SHOW CREATE ROW POLICY {#show-create-row-policy-statement} ## SHOW CREATE ROW POLICY {#show-create-row-policy-statement}
显示了在使用的参数 [创建行策略](create.md#create-row-policy-statement) 显示 [row policy creation](../../sql-reference/statements/create.md#create-row-policy-statement)中用到的参数
### 语法 {#show-create-row-policy-syntax} ### 语法 {#show-create-row-policy-syntax}
@ -148,7 +147,7 @@ SHOW CREATE [ROW] POLICY name ON [database.]table
## SHOW CREATE QUOTA {#show-create-quota-statement} ## SHOW CREATE QUOTA {#show-create-quota-statement}
显示了在使用的参数 [创建配额](create.md#create-quota-statement) 显示 [quota creation](../../sql-reference/statements/create.md#create-quota-statement)中用到的参数
### 语法 {#show-create-row-policy-syntax} ### 语法 {#show-create-row-policy-syntax}
@ -158,7 +157,7 @@ SHOW CREATE QUOTA [name | CURRENT]
## SHOW CREATE SETTINGS PROFILE {#show-create-settings-profile-statement} ## SHOW CREATE SETTINGS PROFILE {#show-create-settings-profile-statement}
显示了在使用的参数 [设置配置文件创建](create.md#create-settings-profile-statement) 显示 [settings profile creation](../../sql-reference/statements/create.md#create-settings-profile-statement)中用到的参数
### 语法 {#show-create-row-policy-syntax} ### 语法 {#show-create-row-policy-syntax}
@ -166,4 +165,4 @@ SHOW CREATE QUOTA [name | CURRENT]
SHOW CREATE [SETTINGS] PROFILE name SHOW CREATE [SETTINGS] PROFILE name
``` ```
[原始文](https://clickhouse.tech/docs/en/query_language/show/) <!--hide--> [原始文](https://clickhouse.tech/docs/en/query_language/show/) <!--hide-->