Skip to content

[Feature Request]: add function bit_count() #23798

@aptend

Description

@aptend

Is there an existing issue for the same feature request?

  • I have checked the existing issues.

Is your feature request related to a problem?

Describe the feature you'd like

MySQL BIT_COUNT() returns the number of bits set in the argument.

Syntax: BIT_COUNT(N), Where N is an integer.

Code:

SELECT BIT_COUNT(8),BIT_COUNT(24),BIT_COUNT(28),BIT_COUNT(255);

Output:

mysql> SELECT BIT_COUNT(8),BIT_COUNT(24),BIT_COUNT(28),BIT_COUNT(255);
+--------------+---------------+---------------+----------------+
| BIT_COUNT(8) | BIT_COUNT(24) | BIT_COUNT(28) | BIT_COUNT(255) |
+--------------+---------------+---------------+----------------+
| 1 | 2 | 3 | 8 |
+--------------+---------------+---------------+----------------+
1 row in set (0.01 sec)

Describe implementation you've considered

No response

Documentation, Adoption, Use Case, Migration Strategy

Additional information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions