bitmap_to_string

description

Syntax

VARCHAR BITMAP_TO_STRING(BITMAP input)

Convert a input BITMAP to a string. The string is a separated string, contains all set bits in Bitmap. If input is null, return null.

example

  1. mysql> select bitmap_to_string(null);
  2. +------------------------+
  3. | bitmap_to_string(NULL) |
  4. +------------------------+
  5. | NULL |
  6. +------------------------+
  7. mysql> select bitmap_to_string(bitmap_empty());
  8. +----------------------------------+
  9. | bitmap_to_string(bitmap_empty()) |
  10. +----------------------------------+
  11. | |
  12. +----------------------------------+
  13. mysql> select bitmap_to_string(to_bitmap(1));
  14. +--------------------------------+
  15. | bitmap_to_string(to_bitmap(1)) |
  16. +--------------------------------+
  17. | 1 |
  18. +--------------------------------+
  19. mysql> select bitmap_to_string(bitmap_or(to_bitmap(1), to_bitmap(2)));
  20. +---------------------------------------------------------+
  21. | bitmap_to_string(bitmap_or(to_bitmap(1), to_bitmap(2))) |
  22. +---------------------------------------------------------+
  23. | 1,2 |
  24. +---------------------------------------------------------+

keyword

  1. BITMAP_TO_STRING,BITMAP