有可能获得所有MySQL系统函数的列表吗?

时间:2012-11-22 16:20:35

标签: mysql

我看起来像:

SHOW FUNCTION STATUS

获取当前服务器版本的所有可用系统函数的列表。可以直接从MySQL引擎获取here这样的表吗?

谢谢!

1 个答案:

答案 0 :(得分:6)

如果您安装了帮助表(大多数二进制发行版都有;如果没有,则会有一个名为fill_help_tables.sql的脚本),您可以输入:

mysql> HELP FUNCTIONS
You asked for help about help category: "Functions"
For more information, type 'help <item>', where <item> is one of the following
topics:
       PROCEDURE ANALYSE
categories:
   Bit Functions
   Comparison operators
   Control flow functions
   Date and Time Functions
   Encryption Functions
   Information Functions
   Logical operators
   Miscellaneous Functions
   Numeric Functions
   String Functions

......然后是:

mysql> HELP String Functions
You asked for help about help category: "String Functions"
For more information, type 'help <item>', where <item> is one of the following
topics:
  ASCII
  BIN
  BINARY OPERATOR
  BIT_LENGTH
  CAST
  CHAR FUNCTION
...

...在最终做类似的事情之前......

mysql> HELP bin
Name: 'BIN'
Description:
Syntax:
BIN(N)

Returns a string representation of the binary value of N, where N is a
....

如何生成自己的列表!

以下查询(在mysql数据库上)在一个列表中提供所有功能及其类别:

SELECT help_category.name, help_topic.name 
FROM help_topic JOIN help_category 
    ON help_category.help_category_id = help_topic.help_category_id 
WHERE help_category.help_category_id IN (
    SELECT help_category_id FROM help_category 
    WHERE parent_category_id=37
) ORDER BY 1;

如果您想要每个文本的说明,只需在description子句中添加SELECT作为列,虽然它很长,但您可能希望使用\G而不是{{ 1}}