HELP Syntax
The HELP statement returns online information from the MariaDB Reference manual. Its proper operation requires that the help tables in the MariaDB database be initialized with help topic information (see , "Server-Side Help").
The HELP statement searches the help tables for the given search string and displays the result of the search. The search string is not case sensitive.
The HELP statement understands several types of search strings:
- At the most general level, use
contentsto retrieve a list of the top-level help categories: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 theCREATE TABLEstatement, 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 will return 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.
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:Yif the name represents a help category,Nif it does not. If it does not, thenamevalue when specified as the argument to theHELPstatement 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 nameis_it_category:Yif the name represents a help category,Nif it does not. If it does not, thenamevalue when specified as the argument to theHELPstatement should yield a single-row result set containing a description for the named item.
Example:
HELP 'functions'Yields: