Syntax
BIT_COUNT(N)
Purpose
BIT_COUNT() returns the number of 1 in the binary value of a numeric value N. If N is NULL, NULL is returned.
Examples
obclient> SELECT BIT_COUNT(42), BIT_COUNT(b'1010');
+---------------+--------------------+
| BIT_COUNT(42) | BIT_COUNT(b'1010') |
+---------------+--------------------+
| 3 | 2 |
+---------------+--------------------+
1 row in set