当前位置:网站首页>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 排序
边栏推荐
猜你喜欢
随机推荐
MySQL 索引详解和什么时候创建索引什么时候不适用索引
三角形个数
【编程学习新起点】记录写博客的第一天
Execute the mysql script file in the docker mysql container and solve the garbled characters
NFT租赁提案EIP-5006步入最后审核!让海外大型游戏的链改成为可能
用iPhone前摄3D人像建模,Meta:我看行
用户登录验证程序的实现
Qlik Sense 字符串截取和拼接详解(Left、Right、&)
Oracle 密码策略详解
浅谈函数递归汉诺塔
玩转Markdown(2) —— 抽象语法树的提取与操纵
中国生物反应器行业市场投资分析及前景预测报告2022~2028年
icebreaker的垃圾话学习指南
The result of request.getParameter is on
中国磷化铟技术行业发展趋势与前景规划建议报告2022~2028年
浏览器多线程离屏渲染压缩打包方案
【HQL】(二) 查询使用正则表达式做列选择
Go (一) 基础部分3 -- 数组,切片(append,copy),map,指针
`monorepo` 中 `hoist` 机制导致加载配置文件路径的变化
中国水煤浆行业“十四五”规划与运营模式分析报告2022~2028年









