当前位置:网站首页>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 排序
边栏推荐
猜你喜欢

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

Flask,7

Delightful Nuxt3 Tutorial (1): Application Creation and Configuration

机器码介绍

处理异步事件的三种方式

边缘辅助无人机网络的分层联邦学习

A-B数对问题|UPC-Count Interval|洛谷-P1102A-B数对

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

玩转Markdown(2) —— 抽象语法树的提取与操纵

嵌入式实验二注意点
随机推荐
7.15(6)
MySQL 排序
【源码解读】你买的NFT到底是什么?
二叉树的合并[C]
【扫雷】多方法超详细 7.28
Haproxy服务监控
机器码介绍
图的最短路径的核心——松弛技术
用户登录验证程序的实现
中国磷化铟晶圆行业发展前景与投资规划分析报告2022~2028年
Router-view
漫谈Map Reduce 参数优化
中国生物反应器行业发展现状及前景规划分析报告报告2022~2028年
request.getParameter的结果为on
The ` monorepo ` ` hoist ` mechanism lead to the change of the loading configuration file path
嵌入式实验二
嵌入式实验四
动态调整web主题(2) 萃取篇
初识C语言
7.24[C语言零基础 知识点总结]