当前位置:网站首页>Oracle null 有哪些注意事项【面试题】
Oracle null 有哪些注意事项【面试题】
2022-08-03 05:22:00 【鱼丸丶粗面】
1 概述
null:空值,未指定的、未知的 或 不可预知的值。
2 示例
2.1 运算
select 1 + null 加,
1 - null 减,
1 * null 乘,
1 / null 除
from dual;
-- 结果都是 null
2.2 判断
with t_test as (
select null a from dual union all
select 1 a from dual
)
select t.*
from t_test t
where t.a is not null;
-- 返回 1
2.3 统计
with t_test as (
select null a from dual union all
select 1 a from dual union all
select 1 a from dual
)
select count(1) a, -- 3
count(*) b, -- 3
count(t.a) c, -- 2
count(distinct t.a) d -- 1
from t_test t;
2.4 子查询
with t_test as (
select null a from dual union all
select 1 a from dual union all
select 1 a from dual
)
select t.a
from t_test t
where t.a not in (null, 2);
-- 返回 null
2.5 连接
select 'a' || null a -- a
from dual;
2.6 排序
边栏推荐
猜你喜欢

The ` monorepo ` ` hoist ` mechanism lead to the change of the loading configuration file path

Apache2-XXE漏洞渗透

Flask,7

Execute the mysql script file in the docker mysql container and solve the garbled characters

关于semantic-ui的cdn失效问题(怎样通过本地引用semantic-ui)

icebreaker的垃圾话学习指南

令人愉快的 Nuxt3 教程 (一): 应用的创建与配置

【DC-2靶场渗透】

用iPhone前摄3D人像建模,Meta:我看行

MySql 怎么查出符合条件的最新的数据行?
随机推荐
中国生活服务O2O行业发展现状与市场规模预测报告2022~2028年
request.getParameter的结果为on
当奈飞的NFT忘记了web2的业务安全
【编程学习新起点】记录写博客的第一天
机器码介绍
The result of request.getParameter is on
中国磷化铟晶圆行业发展前景与投资规划分析报告2022~2028年
MySQL 索引详解和什么时候创建索引什么时候不适用索引
联邦学习摘录
C语言简单实现三子棋小游戏
编程软件配备
私有变量(private) 【详细+易懂】
D-PHY
中国柔性制造系统(FMS)市场发展动态及未来趋势预测报告2022~2028年
小码农的第一篇博客
ansible的安装和部署详细过程,配置清单基本操作
【IDEA】字体修改-护眼主题-文件注释头设置
[Rebound shell and privilege escalation]
MySql 怎么查出符合条件的最新的数据行?
EIP-5058 能否防止NFT项目方提桶跑路?