MySQL 9.0 版本注意事項
HELP 'search_string'
HELP
陳述式會從 MySQL 參考手冊傳回線上資訊。其正常運作需要 mysql
資料庫中的 help 資料表已使用 help 主題資訊初始化(請參閱第 7.1.17 節,「伺服器端說明支援」)。
HELP
陳述式會在 help 資料表中搜尋給定的搜尋字串,並顯示搜尋結果。搜尋字串不區分大小寫。
搜尋字串可以包含萬用字元 %
和 _
。它們的含義與使用 LIKE
運算子執行的模式比對操作相同。例如,HELP 'rep%'
會傳回以 rep
開頭的主題清單。
HELP
陳述式不需要終止符,例如 ;
或 \G
。
HELP
陳述式可以理解數種類型的搜尋字串
在最一般的層級,使用
contents
來檢索頂層的說明類別列表HELP 'contents'
若要取得特定說明類別(例如
Data Types
)中的主題列表,請使用該類別名稱HELP 'data types'
若要取得特定說明主題的說明,例如
ASCII()
函式或CREATE TABLE
陳述式,請使用相關的關鍵字或多個關鍵字HELP 'ascii' HELP 'create table'
換句話說,搜尋字串會符合一個類別、多個主題或單一主題。以下描述說明結果集可能採取的格式。
空白結果
找不到符合搜尋字串的項目。
範例:
HELP 'fake'
產生
Nothing found Please try to run 'help contents' for a list of all accessible topics
包含單一列的結果集
這表示搜尋字串找到了說明主題的相符項目。結果包含下列項目
name
:主題名稱。description
:主題的描述性說明文字。example
:一個或多個使用範例。(可能為空。)
範例:
HELP 'log'
產生
Name: 'LOG' Description: Syntax: LOG(X), LOG(B,X) If called with one parameter, this function returns the natural logarithm of X. If X is less than or equal to 0.0E0, the function returns NULL and a warning "Invalid argument for logarithm" is reported. Returns NULL if X or B is NULL. The inverse of this function (when called with a single argument) is the EXP() function. URL: https://mysqldev.dev.org.tw/doc/refman/8.4/en/mathematical-functions.html Examples: mysql> SELECT LOG(2); -> 0.69314718055995 mysql> SELECT LOG(-2); -> NULL
主題列表。
這表示搜尋字串符合多個說明主題。
範例:
HELP 'status'
產生
Many help items for your request exist. To make a more specific request, please type 'help <item>', where <item> is one of the following topics: FLUSH SHOW SHOW BINARY LOG STATUS SHOW ENGINE SHOW FUNCTION STATUS SHOW PROCEDURE STATUS SHOW REPLICA STATUS SHOW STATUS SHOW TABLE STATUS
主題列表。
如果搜尋字串符合類別,也會顯示列表。
範例:
HELP 'functions'
產生
You asked for help about help category: "Functions" For more information, type 'help <item>', where <item> is one of the following categories: Aggregate Functions and Modifiers Bit Functions Cast Functions and Operators Comparison Operators Date and Time Functions Encryption Functions Enterprise Encryption Functions Flow Control Functions GROUP BY Functions and Modifiers GTID Information Functions Internal Functions Locking Functions Logical Operators Miscellaneous Functions Numeric Functions Performance Schema Functions Spatial Functions String Functions Window Functions XML