当前位置:网站首页>GBase8s数据库select子句2
GBase8s数据库select子句2
2022-06-09 20:44:00 【爱吃萝卜冰冰凉】
IN 条件
当在该关键字右边的值的列表中包括 IN 关键字左边的表达式时,IN 条件是满足的。
下列示例展示 IN 条件:
SELECT lname, fname, company FROM customer
WHERE state IN (‘CA’,‘WA’, ‘NJ’);
SELECT * FROM cust_calls
WHERE user_id NOT IN (USER );
要获取更多信息,请参阅 IN 子查询。
BETWEEN 条件
当 BETWEEN 左边的值在 BETWEEN 右边的两个值的范围之内时,BETWEEN 条件是满足的。
下列示例中的前两个查询在 BETWEEN 关键字之后使用文字值。第三个查询使用内建的
CURRENT 函数和一个文字间隔来搜索当天与七天前之间的日期。
SELECT stock_num, manu_code FROM stock
WHERE unit_price BETWEEN 125.00 AND 200.00;
SELECT DISTINCT customer_num, stock_num, manu_code
FROM orders, items
WHERE order_date BETWEEN ‘6/1/07’ AND ‘9/1/07’;
SELECT * FROM cust_calls WHERE call_dtime
BETWEEN (CURRENT - INTERVAL(7) DAY TO DAY) AND CURRENT;
要获取更多信息,请参阅 BETWEEN 条件。
使用 IS NULL 和 IS NOT NULL 条件
如果指定的 column 包含 NULL 值,或如果指定的 expression 求值为 NULL,则 IS NULL 条件
是满足的。
如果您使用 IS NOT NULL 谓词,则当 column 包含非 NULL 的值时,或当 expression 求值不为
NULL 时,该条件是满足的。下列示例选择尚未支付的订单的订单编号和客户编号:
SELECT order_num, customer_num FROM orders
WHERE paid_date IS NULL;
要获取 IS NULL 和 IS NOT NULL 运算符的完整描述,请参阅 IS NULL 和 IS NOT NULL 条
件。
边栏推荐
- Inheritance relationship in C #
- pyQt QWidget禁止非当前窗口的操作
- Who says redis can't save big keys
- Ceisum 3D scene demo
- ASP.NET手机终端进销存系统,源码分享
- C interface class learning
- Pyqt QWidget prohibits operations that are not current windows
- KubeVirt CICD Tekton (2) - task run:datavolume & ssh-key
- 分享 16 个有用的 TypeScript 和 JS 技巧
- UTM转经纬度
猜你喜欢

ClickHouse 数据插入、更新与删除操作 SQL

The HMI Software memory is abnormal, resulting in a crash exit bug

TypeScript 变量声明

NoSQL redis configuration and optimization (I blew the night breeze of Qinhuai River for you when you were not in Nanjing)

Target Segmentation -- semantic segmentation of multi category dataset by Unet

How Bi makes SaaS products have a "sense of security" and "sensitivity" (Part I)
![[operation and maintenance department] ad domain file permission management](/img/f4/5598384b352b2335145ffa58437439.png)
[operation and maintenance department] ad domain file permission management

Figure guessing game in C language

Blog recommended | bookkeeper - Apache pulsar high availability / strong consistency / low latency storage implementation

SSL(Secure socket Layer)数字证书
随机推荐
C # learning about abstract classes
C#中default的关键词用法
asp. Net TXT read / write
华为云工业智能中枢,为加速工业智能化升级提供新动能
C#中委托的应用
Learn to use PHP to implement unlimited comments and unlimited to secondary comments solutions
刚学嵌入式,想问问什么是中断,中断的概念是什么
C#静态类的扩展应用
Bug in upgrading SD card / TF card of HMI serial interface screen
编程题:统计字符串中出现次数最多的字母
KubeVirt CICD Tekton (2) - task run:datavolume & ssh-key
Common regular expressions
将excel中的合并单元格拆分并填充数据
Go 调用 Kubernetes API 的 几个简单的 example
Go 1.18 new features - workspace
Redis knowledge points
为什么要重写equals和hashcode?
华为云Stack首席架构师:打造“称手”的数字化工具,答好政企IT数字化转型这道必选题
CVPR2022 Oral | 用于实时地图视图语义分割的跨视图Transformer
Xcode 14 brings new improvements, and Xcode cloud is officially launched!