Mega Code Archive

 
Categories / MySQL / Function
 

Bit or

mysql> mysql> mysql> CREATE TABLE BITS (BIN_VALUE INTEGER NOT NULL PRIMARY KEY); Query OK, 0 rows affected (0.00 sec) mysql> INSERT INTO BITS VALUES     -> (CONV(001,2,16)),     -> (CONV(011,2,16)),     -> (CONV(111,2,16)); Query OK, 3 rows affected (0.00 sec) Records: 3  Duplicates: 0  Warnings: 0 mysql> mysql> mysql> mysql> SELECT   BIN(BIT_OR(BIN_VALUE))     -> FROM     BITS; +------------------------+ | BIN(BIT_OR(BIN_VALUE)) | +------------------------+ | 111                    | +------------------------+ 1 row in set (0.00 sec) mysql> mysql> drop table bits; Query OK, 0 rows affected (0.00 sec)