bitmap_xor

description

Syntax

BITMAP BITMAP_XOR(BITMAP lhs, BITMAP rhs)

Compute the symmetric union of two input bitmaps, return the new bitmap.

example

  1. mysql> select bitmap_count(bitmap_xor(bitmap_from_string('2,3'),bitmap_from_string('1,2,3,4'))) cnt;
  2. +------+
  3. | cnt |
  4. +------+
  5. | 2 |
  6. +------+
  7. mysql> select bitmap_to_string(bitmap_xor(bitmap_from_string('2,3'),bitmap_from_string('1,2,3,4')));
  8. +----------------------------------------------------------------------------------------+
  9. | bitmap_to_string(bitmap_xor(bitmap_from_string('2,3'), bitmap_from_string('1,2,3,4'))) |
  10. +----------------------------------------------------------------------------------------+
  11. | 1,4 |
  12. +----------------------------------------------------------------------------------------+

keyword

  1. BITMAP_XOR,BITMAP