BIT_OR

Description

Aggregate function.

The BIT_OR(expr) function returns the bitwise OR of all bits in expr.

Syntax

  1. > BIT_OR(expr)

Arguments

ArgumentsDescription
exprUINT data types

Examples

  1. > drop table if exists t1;
  2. > CREATE TABLE t1 (id CHAR(1), number INT);
  3. > INSERT INTO t1 VALUES
  4. ('a',111),('a',110),('a',100),
  5. ('a',000),('b',001),('b',011);
  6. > select id, BIT_OR(number) FROM t1 GROUP BY id;
  7. +------+----------------+
  8. | id | bit_or(number) |
  9. +------+----------------+
  10. | a | 111 |
  11. | b | 11 |
  12. +------+----------------+