跳到主要内容
版本: 最新版本-3.5

bitmap_max

获取 Bitmap 中的最大值。如果 bitmap 为 NULL,则此函数返回 NULL。如果 bitmap 为空,则默认情况下此函数返回 NULL

语法

bitmap_max(bitmap)

参数

bitmap:要获取最大值的 Bitmap。仅支持 BITMAP 数据类型。您可以指定使用 bitmap_from_string 等函数构建的 Bitmap。

返回值

返回 LARGEINT 数据类型的值。

示例

MySQL > select bitmap_max(bitmap_from_string("0, 1, 2, 3"));
+-------------------------------------------------+
| bitmap_max(bitmap_from_string("0, 1, 2, 3")) |
+-------------------------------------------------+
| 3 |
+-------------------------------------------------+

MySQL > select bitmap_max(bitmap_from_string("-1, 0, 1, 2"));
+-------------------------------------------------+
| bitmap_max(bitmap_from_string("-1, 0, 1, 2")) |
+-------------------------------------------------+
| NULL |
+-------------------------------------------------+

MySQL > select bitmap_max(bitmap_empty());
+----------------------------------+
| bitmap_max(bitmap_empty()) |
+----------------------------------+
| NULL |
+----------------------------------+

mysql> select bitmap_max(bitmap_from_string("1, 16501189037412846863"));
+--------------------------------------------------------------+
| bitmap_max(bitmap_from_string('1, 16501189037412846863')) |
+--------------------------------------------------------------+
| 16501189037412846863 |
+--------------------------------------------------------------+
1 row in set (0.02 sec)