当前位置:网站首页>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 排序
边栏推荐
猜你喜欢
随机推荐
中国生活服务O2O行业发展现状与市场规模预测报告2022~2028年
关于semantic-ui的cdn失效问题(怎样通过本地引用semantic-ui)
A-B数对问题|UPC-Count Interval|洛谷-P1102A-B数对
Flask,7
7.17(7)
MySQL 排序
用iPhone前摄3D人像建模,Meta:我看行
7.7(5)
Apache2-XXE vulnerability penetration
软件测试 -- 入门 1 软件测试是什么?
Sqli-labs-master shooting range 1-23 customs clearance detailed tutorial (basic)
动态规划笔记
Browser multi-threaded off-screen rendering, compression and packaging scheme
动态调整web系统主题? 看这一篇就够了
浅谈函数递归汉诺塔
【命令执行与中间件漏洞】
Ansible installation and deployment detailed process, basic operation of configuration inventory
关于如何向FastAPI的依赖函数添加参数
The ` monorepo ` ` hoist ` mechanism lead to the change of the loading configuration file path
中国生活垃圾处理行业十四五规划与投融资模式分析报告2022~2028年









