文件首頁
MySQL 8.4 參考手冊
相關文件 下載本手冊
PDF (美式信紙) - 39.9Mb
PDF (A4) - 40.0Mb
Man Pages (TGZ) - 258.5Kb
Man Pages (Zip) - 365.5Kb
Info (Gzip) - 4.0Mb
Info (Zip) - 4.0Mb


MySQL 8.4 參考手冊  /  ...  /  HELP 陳述式

15.8.3 HELP 陳述式

HELP 'search_string'

HELP 陳述式會從 MySQL 參考手冊傳回線上資訊。其正常運作需要 mysql 資料庫中的 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