HELP 'search_string
'
The HELP
statement returns online information from the MySQL Reference Manual. HELP
语句返回MySQL参考手册中的联机信息。Its proper operation requires that the help tables in the 它的正确操作要求使用帮助主题信息初始化mysql数据库中的帮助表(请参阅第5.1.17节,“服务器端帮助支持”)。mysql
database be initialized with help topic information (see Section 5.1.17, “Server-Side Help Support”).
The HELP
statement searches the help tables for the given search string and displays the result of the search. HELP
语句在帮助表中搜索给定的搜索字符串,并显示搜索结果。The search string is not case-sensitive.搜索字符串不区分大小写。
The search string can contain the wildcard characters %
and _
. These have the same meaning as for pattern-matching operations performed with the LIKE
operator. For example, HELP 'rep%'
returns a list of topics that begin with rep
.
The HELP statement understands several types of search strings:HELP语句理解几种类型的搜索字符串:
At the most general level, use 在最一般的级别上,使用contents
to retrieve a list of the top-level help categories:content
检索顶级帮助类别的列表:
HELP 'contents'
For a list of topics in a given help category, such as Data Types
, use the category name:
HELP 'data types'
For help on a specific help topic, such as the ASCII()
function or the CREATE TABLE
statement, use the associated keyword or keywords:
HELP 'ascii' HELP 'create table'
In other words, the search string matches a category, many topics, or a single topic. 换句话说,搜索字符串匹配一个类别、多个主题或单个主题。You cannot necessarily tell in advance whether a given search string returns a list of items or the help information for a single help topic. 您不一定要提前知道给定的搜索字符串是返回项目列表还是返回单个帮助主题的帮助信息。However, you can tell what kind of response 但是,您可以通过检查结果集中的行数和列数来判断返回的响应HELP
returned by examining the number of rows and columns in the result set.HELP
类型。
The following descriptions indicate the forms that the result set can take. 以下说明说明了结果集可以采用的形式。Output for the example statements is shown using the familiar “tabular” or “vertical” format that you see when using the mysql client, but note that mysql itself reformats HELP
result sets in a different way.
Empty result set空结果集
No match could be found for the search string.找不到搜索字符串的匹配项。
Result set containing a single row with three columns包含一行三列的结果集
This means that the search string yielded a hit for the help topic. 这意味着搜索字符串生成了对帮助主题的点击。The result has three columns:结果有三列:
name
: The topic name.:主题名称。
description
: Descriptive help text for the topic.:主题的描述性帮助文本。
example
: Usage example or examples. :用法示例。This column might be blank.此列可能为空。
Example: 例子: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'
Result set containing multiple rows with two columns包含多行两列的结果集
This means that the search string matched many help topics. 这意味着搜索字符串匹配了许多帮助主题。The result set indicates the help topic names:结果集指示帮助主题名称:
name
: The help topic name.:帮助主题名称。
is_it_category
: Y
if the name represents a help category, N
if it does not. If it does not, the name
value when specified as the argument to the HELP
statement should yield a single-row result set containing a description for the named item.
Example: 例子: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 | +-----------------------+----------------+
Result set containing multiple rows with three columns包含多行三列的结果集
This means the search string matches a category. 这意味着搜索字符串与类别匹配。The result set contains category entries:结果集包含类别条目:
source_category_name
: The help category name.:帮助类别名称。
name
: The category or topic name:类别或主题名称
is_it_category
: Y
if the name represents a help category, N
if it does not. If it does not, the name
value when specified as the argument to the HELP
statement should yield a single-row result set containing a description for the named item.
Example: 例子: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 | +----------------------+-------------------------+----------------+