Syntax
BIT_COUNT(N)
Purpose
You can call this function to return 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 (0.00 sec)