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 函数 (E-O)

 

GET_BIT 函数 [Bit array]

返回位数组中指定位的值(1 或 0)。

语法
GET_BIT( bit-expression, position )
参数
  • bit-expression   包含该位的位数组。

  • position   要返回状态的位的位置。

返回值

BIT

注释

数组中的位置从左侧开始计数(从 1 开始)。

如果 position 超出数组的长度,则返回 0 (false)。

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

示例

以下语句返回值 1:

SELECT GET_BIT( '00110011' , 4 );

以下语句返回值 0:

SELECT GET_BIT( '00110011' , 5 );