- PostgreSQL 教程
- PostgreSQL - 首页
- PostgreSQL - 概述
- PostgreSQL - 环境搭建
- PostgreSQL - 语法
- PostgreSQL - 数据类型
- PostgreSQL - 创建数据库
- PostgreSQL - 选择数据库
- PostgreSQL - 删除数据库
- PostgreSQL - 创建表
- PostgreSQL - 删除表
- PostgreSQL - 模式
- PostgreSQL - 插入查询
- PostgreSQL - 选择查询
- PostgreSQL - 运算符
- PostgreSQL - 表达式
- PostgreSQL - WHERE 子句
- PostgreSQL - AND & OR 子句
- PostgreSQL - 更新查询
- PostgreSQL - 删除查询
- PostgreSQL - LIKE 子句
- PostgreSQL - LIMIT 子句
- PostgreSQL - ORDER BY 子句
- PostgreSQL - GROUP BY
- PostgreSQL - WITH 子句
- PostgreSQL - HAVING 子句
- PostgreSQL - DISTINCT 关键字
- 高级 PostgreSQL
- PostgreSQL - 约束
- PostgreSQL - 连接
- PostgreSQL - UNION 子句
- PostgreSQL - NULL 值
- PostgreSQL - 别名语法
- PostgreSQL - 触发器
- PostgreSQL - 索引
- PostgreSQL - ALTER TABLE 命令
- TRUNCATE TABLE 命令
- PostgreSQL - 视图
- PostgreSQL - 事务
- PostgreSQL - 锁
- PostgreSQL - 子查询
- PostgreSQL - 自动递增
- PostgreSQL - 权限
- 日期/时间函数和运算符
- PostgreSQL - 函数
- PostgreSQL - 常用函数
- PostgreSQL 接口
- PostgreSQL - C/C++
- PostgreSQL - Java
- PostgreSQL - PHP
- PostgreSQL - Perl
- PostgreSQL - Python
- PostgreSQL 资源
- PostgreSQL - 快速指南
- PostgreSQL - 资源
- PostgreSQL - 讨论
PostgreSQL 位运算符
以下是一些简单的例子,展示了 PostgreSQL 位运算符的用法。
假设变量 A 为 60,变量 B 为 13,则:
testdb=# select 60 | 13;
?column?
----------
61
(1 row)
testdb=# select 60 & 13;
?column?
----------
12
(1 row)
testdb=# select (~60);
?column?
----------
-61
(1 row)
testdb=# select (60 << 2);
?column?
----------
240
(1 row)
testdb=# select (60 >> 2);
?column?
----------
15
(1 row)
testdb=# select 60 # 13;
?column?
----------
49
(1 row)
postgresql_operators.htm
广告