--- { "title": "bitmap_xor", "language": "zh-CN" } --- # bitmap_xor ## description ### Syntax `BITMAP BITMAP_XOR(BITMAP lhs, BITMAP rhs)` 计算两个输入bitmap的差集,返回新的bitmap. ## example ``` mysql> select bitmap_count(bitmap_xor(bitmap_from_string('2,3'),bitmap_from_string('1,2,3,4'))) cnt; +------+ | cnt | +------+ | 2 | +------+ mysql> select bitmap_to_string(bitmap_xor(bitmap_from_string('2,3'),bitmap_from_string('1,2,3,4'))); +----------------------------------------------------------------------------------------+ | bitmap_to_string(bitmap_xor(bitmap_from_string('2,3'), bitmap_from_string('1,2,3,4'))) | +----------------------------------------------------------------------------------------+ | 1,4 | +----------------------------------------------------------------------------------------+ ``` ## keyword BITMAP_XOR,BITMAP