Data Types MySQL Tutorial

Returns the number of bits that are set in the argument N.

SELECT BIT_COUNT(29), BIT_COUNT(b'101010');