Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (中文) » SQL Anywhere 服务器 - SQL 参考 » 使用 SQL » SQL 函数 » SQL 函数 (A-D)

 

COUNT_SET_BITS 函数 [Bit array]

返回数组中设为 1 (TRUE) 的位数的计数。

语法
COUNT_SET_BITS( bit-expression )
参数
  • bit-expression   要确定置位的位数组。

返回值

UNSIGNED INT

注释

如果 bit-expression 为 NULL,则返回 NULL。

标准和兼容性
  • SQL/2003   服务商扩充。

示例

以下语句返回值 4:

SELECT COUNT_SET_BITS( '00110011' );

以下语句返回值 12:

SELECT COUNT_SET_BITS( '0011001111111111' );