SQL BIT_COUNT()函数
BIT_COUNT(numeric_value)
BIT_COUNT()函数返回活跃在数字值的位数。 下面的例子演示了使用BIT_COUNT()函数返回激活位的数字为一系列的数字:
SQL> SELECT BIT_COUNT(2) AS TWO, BIT_COUNT(4) AS FOUR, BIT_COUNT(7) AS SEVEN +-----+------+-------+ | TWO | FOUR | SEVEN | +-----+------+-------+ | 1 | 1 | 3 | +-----+------+-------+ 1 row in set (0.00 sec)