mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-17 20:02:05 +00:00
cd14f9ebcb
* split up select.md * array-join.md basic refactoring * distinct.md basic refactoring * format.md basic refactoring * from.md basic refactoring * group-by.md basic refactoring * having.md basic refactoring * additional index.md refactoring * into-outfile.md basic refactoring * join.md basic refactoring * limit.md basic refactoring * limit-by.md basic refactoring * order-by.md basic refactoring * prewhere.md basic refactoring * adjust operators/index.md links * adjust sample.md links * adjust more links * adjust operatots links * fix some links * adjust aggregate function article titles * basic refactor of remaining select clauses * absolute paths in make_links.sh * run make_links.sh * remove old select.md locations * translate docs/es * translate docs/fr * translate docs/fa * remove old operators.md location * change operators.md links * adjust links in docs/es * adjust links in docs/es * minor texts adjustments * wip * update machine translations to use new links * fix changelog * es build fixes * get rid of some select.md links * temporary adjust ru links * temporary adjust more ru links * improve curly brace handling * adjust ru as well * fa build fix * ru link fixes * zh link fixes * temporary disable part of anchor checks
4.4 KiB
4.4 KiB
machine_translated | machine_translated_rev | toc_priority | toc_title |
---|---|---|---|
true | 72537a2d52 |
38 | SHOW |
显示查询
SHOW CREATE TABLE
SHOW CREATE [TEMPORARY] [TABLE|DICTIONARY] [db.]table [INTO OUTFILE filename] [FORMAT format]
返回单 String
-类型 ‘statement’ column, which contains a single value – the CREATE
用于创建指定对象的查询。
SHOW DATABASES
SHOW DATABASES [INTO OUTFILE filename] [FORMAT format]
打印所有数据库的列表。
这个查询是相同的 SELECT name FROM system.databases [INTO OUTFILE filename] [FORMAT format]
.
SHOW PROCESSLIST
SHOW PROCESSLIST [INTO OUTFILE filename] [FORMAT format]
输出的内容 系统。流程 表,包含目前正在处理的查询列表,除了 SHOW PROCESSLIST
查询。
该 SELECT * FROM system.processes
查询返回有关所有当前查询的数据。
提示(在控制台中执行):
$ watch -n1 "clickhouse-client --query='SHOW PROCESSLIST'"
SHOW TABLES
显示表的列表。
SHOW [TEMPORARY] TABLES [{FROM | IN} <db>] [LIKE '<pattern>' | WHERE expr] [LIMIT <N>] [INTO OUTFILE <filename>] [FORMAT <format>]
如果 FROM
如果未指定子句,则查询返回当前数据库中的表列表。
你可以得到相同的结果 SHOW TABLES
通过以下方式进行查询:
SELECT name FROM system.tables WHERE database = <db> [AND name LIKE <pattern>] [LIMIT <N>] [INTO OUTFILE <filename>] [FORMAT <format>]
示例
下面的查询从表的列表中选择前两行 system
数据库,其名称包含 co
.
SHOW TABLES FROM system LIKE '%co%' LIMIT 2
┌─name───────────────────────────┐
│ aggregate_function_combinators │
│ collations │
└────────────────────────────────┘
SHOW DICTIONARIES
显示列表 外部字典.
SHOW DICTIONARIES [FROM <db>] [LIKE '<pattern>'] [LIMIT <N>] [INTO OUTFILE <filename>] [FORMAT <format>]
如果 FROM
如果未指定子句,则查询从当前数据库返回字典列表。
你可以得到相同的结果 SHOW DICTIONARIES
通过以下方式进行查询:
SELECT name FROM system.dictionaries WHERE database = <db> [AND name LIKE <pattern>] [LIMIT <N>] [INTO OUTFILE <filename>] [FORMAT <format>]
示例
下面的查询从表的列表中选择前两行 system
数据库,其名称包含 reg
.
SHOW DICTIONARIES FROM db LIKE '%reg%' LIMIT 2
┌─name─────────┐
│ regions │
│ region_names │
└──────────────┘
SHOW GRANTS
显示用户的权限。
语法
SHOW GRANTS [FOR user]
如果未指定user,则查询返回当前用户的权限。
SHOW CREATE USER
显示了在使用的参数 用户创建.
SHOW CREATE USER
不输出用户密码。
语法
SHOW CREATE USER [name | CURRENT_USER]
SHOW CREATE ROLE
显示了在使用的参数 角色创建
语法
SHOW CREATE ROLE name
SHOW CREATE ROW POLICY
显示了在使用的参数 创建行策略
语法
SHOW CREATE [ROW] POLICY name ON [database.]table
SHOW CREATE QUOTA
显示了在使用的参数 创建配额
语法
SHOW CREATE QUOTA [name | CURRENT]
SHOW CREATE SETTINGS PROFILE
显示了在使用的参数 设置配置文件创建
语法
SHOW CREATE [SETTINGS] PROFILE name