bit_and()

返回提供的参数中所有位的按位AND的函数

bit_and() 是一个系统函数,它返回提供的参数中所有位的按位AND。

bit_and() 添加于 PostgreSQL 8.0

用法

bit_and ( smallint ) → smallint

bit_and ( integer ) → integer

bit_and ( bigint ) → bigint

bit_and ( bit ) → bit

变更历史

示例

bit_and() 的基本示例

postgres=# CREATE TABLE foo (x INT);
CREATE TABLE

postgres=# INSERT INTO foo VALUES(100),(110),(111);
INSERT 0 3

postgres=# SELECT bit_and(x), bit_or(x), bit_xor(x) FROM foo;
 bit_and | bit_or | bit_xor 
---------+--------+---------
     100 |    111 |     101

分类

系统函数

另请参阅

bit_or(), bit_xor()

反馈

请在此处 提交有关“bit_and()”的任何评论、建议或更正