MySQL BIT_COUNT 函数
-
定义和用法
BIT_COUNT - 返回有效位。 -
语法
BIT_COUNT(numeric_value)
返回数字值中有效的位数。 下面的示例演示如何使用BIT_COUNT函数返回一系列数字的有效位数 -
示例
尝试一下mysql> 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)