bit_count
description
Syntax
BIT_COUNT(Integer-type x)
统计整型 x 的二的补码表示中 1 的个数。
整型可以是:TINYINT、SMALLINT、INT、BIGINT、LARGEINT
example
select "0b11111111", bit_count(-1)
--------------
+--------------+---------------+
| '0b11111111' | bit_count(-1) |
+--------------+---------------+
| 0b11111111 | 8 |
+--------------+---------------+
keywords
BITCOUNT, BIT_COUNT