13.8.3 帮助声明

HELP 'search_string'

HELP语句返回《 MySQL 参考手册》中的在线信息。它的正确操作要求使用帮助主题信息(参见第 5.1.14 节“服务器端帮助支持”)来初始化mysql数据库中的帮助 table。

HELP语句在帮助 table 中搜索给定的搜索字符串,并显示搜索结果。搜索字符串不区分大小写。

搜索字符串可以包含通配符%_。这些含义与使用LIKE运算符执行的模式匹配操作相同。例如,HELP 'rep%'返回以rep开头的主题列 table。

HELP 语句了解几种类型的搜索字符串:

HELP 'contents'
HELP 'data types'
HELP 'ascii'
HELP 'create table'

换句话说,搜索字符串匹配类别,许多主题或单个主题。您不一定必须事先告知给定的搜索字符串是否将返回项目列 table 或单个帮助主题的帮助信息。但是,您可以通过检查结果集中的行数和列数来判断返回的响应HELP的类型。

以下描述指示结果集可以采用的形式。示例语句的输出以使用mysqlClient 端时看到的熟悉的“table 格”或“垂直”格式显示,但请注意mysql本身以不同的方式重新格式化HELP结果集。

找不到匹配的搜索字符串。

这意味着搜索字符串对帮助主题产生了影响。结果包含三列:

示例:HELP 'replace'

Yields:

name: REPLACE
description: Syntax:
REPLACE(str,from_str,to_str)

Returns the string str with all occurrences of the string from_str
replaced by the string to_str. REPLACE() performs a case-sensitive
match when searching for from_str.
example: mysql> SELECT REPLACE('www.mysql.com', 'w', 'Ww');
        -> 'WwWwWw.mysql.com'

这意味着搜索字符串匹配许多帮助主题。结果集指示帮助主题名称:

示例:HELP 'status'

Yields:

+-----------------------+----------------+
| name                  | is_it_category |
+-----------------------+----------------+
| SHOW                  | N              |
| SHOW ENGINE           | N              |
| SHOW MASTER STATUS    | N              |
| SHOW PROCEDURE STATUS | N              |
| SHOW SLAVE STATUS     | N              |
| SHOW STATUS           | N              |
| SHOW TABLE STATUS     | N              |
+-----------------------+----------------+

这意味着搜索字符串与类别匹配。结果集包含类别条目:

示例:HELP 'functions'

Yields:

+----------------------+-------------------------+----------------+
| source_category_name | name                    | is_it_category |
+----------------------+-------------------------+----------------+
| Functions            | CREATE FUNCTION         | N              |
| Functions            | DROP FUNCTION           | N              |
| Functions            | Bit Functions           | Y              |
| Functions            | Comparison operators    | Y              |
| Functions            | Control flow functions  | Y              |
| Functions            | Date and Time Functions | Y              |
| Functions            | Encryption Functions    | Y              |
| Functions            | Information Functions   | Y              |
| Functions            | Logical operators       | Y              |
| Functions            | Miscellaneous Functions | Y              |
| Functions            | Numeric Functions       | Y              |
| Functions            | String Functions        | Y              |
+----------------------+-------------------------+----------------+
首页